반응형

[SNS] facebook에 url공유를 했는데, 자꾸 이전정보가 나온다면?

페이지를 찾지 못한다면?

 

그건 페이스북에 해당 url에 대한 cache가 남아있어서이다.

 

아래 url로 들어가서 원하는 url을 입력하고 테스트 해보면 확인 가능하고, cache도 지워진다.

 

 

https://developers.facebook.com/tools/debug

 

 

 

 

 

반응형
반응형

[jQuery] 모든 라디오버튼, 체크박스 클릭시 로그인하라는 경고 보여주시

 

        $("[type='radio']").click(function(e){
            if (uid == ""){
       alert('로그인 후 이용해 주세요');
                $(this).attr("checked",false);
            }
        });
        $("[type='checkbox']").click(function(e){
            if (uid == ""){
       alert('로그인 후 이용해 주세요');
                $(this).attr("checked",false);
            }
        });

반응형
반응형

sublime text2  - 한글인코딩(euc-kr) 적용하기

 

아래 Github 들어가서 다운로드 받은 후에 Sublime에 [Preferences] - [Browser Package] 에 추가하면 된다.

추가 후 재실행하고, [File] - [Set File Encoding to] 에 보면 euc-kr 있다.

 

A Sublime Text 2 & 3 plugin for editing and saving files encoded in GBK, BIG5, EUC-KR, EUC-JP, Shift_JIS, etc.

https://github.com/seanliang/ConvertToUTF8

 

Description (中文说明见README.zh_CN.md)

With this plugin, you can edit and save the files which encodings are not supported by Sublime Text currently, especially for those used by CJK users, such as GB2312, GBK, BIG5, EUC-KR, EUC-JP, etc.

ConvertToUTF8

I'm working on making ConvertToUTF8 support both Sublime Text 2 and 3 currently. If this plugin is useful for you, you might want to buy me a cup of coffee to keep me fresh. Thanks! :)

Buy me a cup of coffee via PayPalBuy me a cup of coffee via Alipay

Note

** For Linux users: ConvertToUTF8 relies on several dynamic libraries which are missing in embedded version of Python of Sublime Text 2 and 3. This plugin can not work fully until you install them manully.

** For OS X users: Sublime Text 3 uses an embedded Python which is facing the same problem as Linux version.

** I've reported this problem to Jon but did not get any response yet, so I will create extra plugins to solve it. If you are eager to use this plugin before they are released, please contact me for more information.

Installation

Using Package Control to find, install and upgrade ConvertToUTF8 is the recommended method to install this plug-in.

Otherwise, you can download this repository as a zip file, unzip it, and rename the new folder to ConvertToUTF8, then move this folder to Packages folder of Sublime Text (You can find the Packages folder by clicking "Preferences > Browse Packages" menu entry in Sublime Text).

Your folder hierarchy should look like this:

Folder Hierarchy

Configuration

Please check ConvertToUTF8.sublime-settings file for details. You should save your personal settings in a file named "ConvertToUTF8.sublime-settings" under "User" folder.

  • encoding_list: encoding selection list when detection is failed
  • max_cache_size: maximum encoding cache size, 0 means no cache (default: 100)
  • max_detect_lines: maximum detection lines, 0 means unlimited (default: 600)
  • preview_action: specific the action when previewing a file, available options: no_action, convert_and_open (default: no_action)
  • default_encoding_on_create: specific the default encoding for newly created file (such as "GBK"), empty value means using sublime text's "default_encoding" setting (default: empty)
  • convert_on_load: enable/disable convert file content to UTF-8 when it is loaded, available options: always, never (default: always)
  • convert_on_save: enable/disable convert file from UTF-8 to a specific encoding when it is saved, available options: always, never (default: always)

Usage

In most cases, this plug-in will take care of encoding issues automatically.

You can also use the "File > Set File Encoding to" menu entry to transform between different encodings. For example, you can open a UTF-8 file, and save it to GBK, and vice versa.

Note:

  • if "convert_on_save" is set to never, the file will NEVER be saved to the selected encoding
  • please do not edit the file before the encoding detection process is finished
  • please try either increasing the value of max_detect_lines or set the encoding manually if the detection result is not accurate

 

 

 

반응형
반응형

 file 첨부 스타일 변경하기

 

http://www.quirksmode.org/dom/inputfile.html

 

 

div.fakefile{position:absolute;top:85px;right:64px;z-index:1;}
div.fakefile .ff{position:relative;}
div.fakefile img{position:absolute;top:7px;right:0;vertical-align:bottom;}
input.file{position:absolute;top:82px;right:61px;-moz-opacity:0;filter:alpha(opacity:0);opacity:0;z-index:2;cursor:pointer;}

 

<!--div  class="fileinputs"-->
                <input type="file" name="첨부파일_file" style="display:;" class="file" value="찾기" />
                <div class="fakefile" >
                  <div class="ff">
                      <input type="text" name="sns_file2" class="ip_txt1 " readonly=readonly/>
                      <img src="버튼.jpg" alt="찾기" />
                  </div>
                </div>
            <!--/div-->

 

Styling an input type="file"

The problem

For a site I created I needed input fields like this one:

The designer wanted the same styles, plus a "Select" image, to apply to all file upload fields. When I applied the rules of normal input fields to file upload fields, though, it didn't really work. There were wild differences between the browsers, and styling the default button is totally impossible.

Ponder the differences.

Screenshot: File input fields in the various browsersFile input fields in the various browsers

This is hardly what anyone would call a nicely designed form field. Until recently, though, it was the best we could do.

Also note Safari's fundamentally different approach. The Safari team has probably decided on this approach to disallow the manual entering of a file name and this avoid exploits like this one. The drawback is that the user can't decide not to upload a file after having selected one.

The solution

Fortunately, reader Michael McGrady invented a very neat trick that allows us to (more or less) style file upload fields. The credits for the solution presented on this page are wholly his, I only added the position: relative, a few notes and tests, and ported it entirely to JavaScript.

Without the technique your browser reacts like this:

Using McGrady's technique, I was able to produce this file upload field:

 

Now that looks much better, doesn't it? (Provided your browser supports opacity)

McGrady's technique is elegant in its simplicity:

  1. Take a normal <input type="file"> and put it in an element with position: relative.
  2. To this same parent element, add a normal <input> and an image, which have the correct styles. Position these elements absolutely, so that they occupy the same place as the <input type="file">.
  3. Set the z-index of the <input type="file"> to 2 so that it lies on top of the styled input/image.
  4. Finally, set the opacity of the <input type="file"> to 0. The <input type="file">now becomes effectively invisible, and the styles input/image shines through,but you can still click on the "Browse" button. If the button is positioned on top of the image, the user appears to click on the image and gets the normal file selection window.
    (Note that you can't use visibility: hidden, because a truly invisible element is unclickable, too, and we need the <input type="file"> to remain clickable)

Until here the effect can be achieved through pure CSS. However, one feature is still lacking.

  1. When the user has selected a file, the visible, fake input field should show the correct path to this file, as a normal <input type="file"> would. It's simply a matter of copying the new value of the <input type="file"> to the fake input field, but we need JavaScript to do this.

Therefore this technique will not wholly work without JavaScript. For reasons I'll explain later, I decided to port the entire idea to JavaScript. If you're willing to do without the visible file name you can use the pure CSS solution. I'm not sure if this would be a good idea, though.

The HTML/CSS structure

I've decided on the following HTML/CSS approach:

div.fileinputs {
	position: relative;
}

div.fakefile {
	position: absolute;
	top: 0px;
	left: 0px;
	z-index: 1;
}

input.file {
	position: relative;
	text-align: right;
	-moz-opacity:0 ;
	filter:alpha(opacity: 0);
	opacity: 0;
	z-index: 2;
}

<div class="fileinputs">
	<input type="file" class="file" />
	<div class="fakefile">
		<input />
		<img src="search.gif" />
	</div>
</div>

 

반응형
반응형

문제가 생기는 것은 그리 나쁜 일이 아니다.
위기에 대처하는 것은 성공 주기를 늦추는 대신 오히려 가속화할 수 있다.
과거에 문제를 성공적으로 해결한 사람들은
새로운 위협이 닥쳐도 위기감을 덜 느낀다.
리더의 잠재력을 가진 사람들은
위기극복에 성공하거나 역경을 무사히 극복했을 때 더 강해질 수 있다.
- 로자베스 모스 캔터 하버드 교수

 

장애나 역경이 없는 인생은 가능성도 그만큼 낮아집니다.
대중의 무지는 교육의 존재 의미가 되고, 병은 의학의 존재 의미,
사회적 무질서는 정부가 존재하는 이유가 됩니다. (존 맥스웰의 성공이야기)
큰 꿈을 가진 사람은 ‘문제는 회피가 아닌 환영의 대상’으로 인식합니다.

 

반응형
반응형
그림자를 두려워 말라. 그림자란 빛이 어딘가 가까운 곳에서 비치고 있음을 뜻하는 것이다. - 루스 E.렌컬 -

 

반응형
반응형

좋은 부모가 되기란 정말 어렵다.
아이를 사랑하는 마음만으로는 아이를 제대로
키울 수 없기 때문이다. 아동기에 나타나는
낮은 자존감과 자신감의 결여는 부모가
아이 양육에 대한 구체적인 준비 없이
키웠기 때문이다. 가장 시급한 준비는
아이에게 엄청난 영향을 주는 말을
어떻게 사용할지를 공부하는
일이다.


- 신언혁의《지혜롭게 키운 자녀가 성공한다》 중에서 -


* 부모된 사람은
자식들을 말로 키웁니다.
사랑의 말, 훈계의 말, 꿈꾸게 하는 말...
하지만 부모의 사랑의 말이 때때로 자식들에게는
미움의 말로 전달됩니다. 훈계의 말은 반항으로,
꿈꾸게 하는 말은 현실을 모르는 황당한 말로
받아들입니다. '잘 말하는 법'을 공부해야
좋은 부모가 될 수 있습니다.

반응형

'생활의 발견 > 아침편지' 카테고리의 다른 글

허준과 유의태  (0) 2013.09.16
멋지게 살기 위해서  (0) 2013.09.14
감각을 살려라  (0) 2013.09.12
맛있는 밥  (0) 2013.09.11
의식 있는 진화  (0) 2013.09.10
반응형

URL 인코딩으로 알려진 인코딩의 공식 명칭은 Percent-encoding이다.

URL (Uniform Resource Locator)뿐만 아니라 URN (Uniform Resource Name)도 포함하는

URI (Uniform Resource Identifier)에서 사용하는 인코딩이다.

URI에 허용되는 문자는 크게 reserved와 unreserved로 나뉜다.

 

$("#sns_url").keyup(function(event){
            if (!(event.keyCode >=37 && event.keyCode<=40)) {
                var inputVal = $(this).val();
                $(this).val(inputVal.replace(/[^a-z0-9!*();:@&=+$%,./?#_]/gi,''));
            }
        });

 

 

reserved 문자는 다음과 같다.

! * ' ( ) ; : @ & = + $ , / ? # [ ]

unreserved 문자는 다음과 같다.

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
a b c d e f g h i j k l m n o p q r s t u v w x y z
0 1 2 3 4 5 6 7 8 9 - _ . ~

reserved와 unreserved에 해당하지 않는다면,

모두 Percent-encoding되어야 한다.

reserved 문자는 특별한 의미를 갖는데

특별한 의미없이 사용하려면, Percent-encoding되어야 한다.

Percent-encoding은 ASCII인 경우 ASCII 값의 16진수 표현 앞에 %를 붙인다.

non-ASCII인 경우 인코딩에 따라 각 바이트를 16진수 표현으로 바꾸고 앞에 %를 붙인다.

다음은 각 reserved 문자의 Percent-encoding 값이다.

! # $ & ' ( ) * + , / : ; = ? @ [ ]
%21 %23 %24 %26 %27 %28 %29 %2A %2B %2C %2F %3A %3B %3D %3F %40 %5B %5D

unreserved 문자의 경우 인코딩될 필요도 없고,

인코딩하더라도 자기 자신이 반환된다.

마찬가지로 unreserved 문자를 디코딩하더라도 자기 자신이 반환된다.

Reference:
http://en.wikipedia.org/wiki/Percent-encoding

반응형

+ Recent posts