2009-10-01ãã1ã¶æéã®è¨äºä¸è¦§
text-shadowã§æåã«å½±ãè½ã¨ããµã³ãã«ã§ãã FireFox3.5以éã¨safariã§ã®ã¿å®è£ ããã¦ããæ©è½ã¨ã®ãã¨ãIEã§ã¯åä½ããªãã®ã§ã注æ ãã©ã¡ã¼ã¿ã¯ãx座æ¨ãy座æ¨ãã¼ããå ·åãè²ãã¾ãã¯ããè²ãx座æ¨ãy座æ¨ãã¼ããå ·åãã®é ã§æå®ãã¾ãã /* * å½±ãâ¦
Mixinã¯å¼æ°ãåãä»ããããã«ã§ããé¢æ°ã®ããã«ä½¿ããã¨ãå¯è½ã§ãã // å¼æ°ãåãåãmixin =test(!color) color = !color border: 1px solid #{!color*3} .foo // å¼æ°ã¤ãã§mixinãé©ç¨ããã +test(#111) font-size: 12px .var +test(#222) font-sizâ¦
Mixinã§ããããããå®ç¾©ããCSSããããã£ã®éåããè¤æ°ã®ã«ã¼ã«ã»ããã«é©ç¨ãããã¨ãã§ãã¾ãããã使ãããããã£ã»ãããMixinã§ããããã«ãã¦ããã°ãå®ç¾©ãéè¤ãã¦ãã¾ãã®ãåé¿ã§ãã¾ãã使ãæ¹ã¯ä»¥ä¸ã®éãã ã=ãã§ãMixinããCSSããããã£â¦
SASSã§ã¯ifãforãªã©ã®åºæ¬çãªå¶å¾¡æ§æã使ãã¾ãã æ¡ä»¶åå² ã@ifãã使ãã¾ãã @if <æ¡ä»¶> ...<å¦ç> @else if <æ¡ä»¶> ...<å¦ç> @else ...<å¦ç>以ä¸ã¯ãã©ã°ãè¦ã¦CSSããããã£ãåãæ¿ããä¾ã§ãã !debug = true div // ãã©ã°ãã¿ã¦ããããã£ãâ¦
å¼ã£è¶ãã®ãã10/28ããjijiã®ãã¢ãµã¤ããåæ¢ãã¾ããåèµ·åã¯ãæ°å± ããããã«ç¹ãã£ã¦ããã«ãªãã¾ãããªãã¹ãæ©ã復帰ããããã¨ããã§ãããç³ãè¾¼ãã ãããã¤ãããããã¬ã¹ãã³ã¹ããªãç¶æ³ãããããã»ã»ã»ããã¼ãã¡ããã¨ç³ãè¾¼ãã¦ãããª?
ã#{!}ãã§ã»ã¬ã¯ã¿ãããããã£åã«å¤æ°ã使ããã¨ãã§ãã¾ãã !name="foo" !color="color" div.#{!name} background-#{!color}: #333 å¤æçµæã§ãã div.foo { background-color: #333; }
ã+ããã*ãã¨ãã£ãæ¼ç®åã使ãã¾ãã // æ¼ç®åã使ãã // å¤æ°ã®åç §æã¨åããã=ãã使ãç¹ã®ã¿æ³¨æã .foo width = 10px + 10px height = 10px - 5px .var width = 10px * 10 height = 10px / 5 font-size = 10px % 2 å¤æçµæã§ãã .foo { width:â¦
!<å¤æ°å> = <å¤>ã§å®ç¾©ãã¦ã以ä¸ã®ãããªæãã§åç §ãã¾ãã .foo color = !<å¤æ°å>å ·ä½ä¾ã // å¤æ°ã使ã !color = #333 .foo // ä½æããå¤æ°ã¯ã=ãã§åç §ã§ããã // ã:ããããªãã®ã§ã注æã color = !color // å¤æ°ãªã®ã§å¤ãæ´æ°å¯è½ã !color â¦
ã-tããªãã·ã§ã³ã§å¤æå¾ã®CSSã®ã¹ã¿ã¤ã«ãæå®ã§ãã¾ãã $ sass -t <ã¹ã¿ã¤ã«> <å¤æå ã®SASS> <å¤æå¾ã®CSS>ããã¨ãã¦æå®å¯è½ãªå¤ã¯ä»¥ä¸ã®4ã¤ã å¤ èª¬æ nested SASSã§ã®è¨è¿°ã«ä¼¼ãæãã®ã¹ã¿ã¤ã«ã§åºåãã¾ãã(ããã©ã«ã) expanded ææ¸ãã®CSSã«è¿â¦
CleverCSS: Rich Python-like DSL for CSSããã®ãªã³ã¯ãããSASSãªããã®ãçºè¦ã ãSASSãã¯CSSãããç°¡æ½ã«èªã¿ãããæ¸ãçºã®DSLã§ã 以ä¸ã®ãããªæ©è½ãæä¾ãã¾ãã ãã¹ãã§ã®ããããã£æå® å¤æ° ä¸åº¦å®ç¾©ããè¨å®å¤ã®å ±æ(mixin) å®ç¾©ããã.sassãâ¦
coliss - ã¹ã¿ã¤ã«ã·ã¼ãã®è¨è¿°ãããèªã¿ããããã5ã¤ã®ã«ã¼ã«ãããCSSã§ã¤ã³ãã³ããã¼ããã®çºæ³ã¯ãªãã£ããªã¼ã #nav{ width:650px; } #nav ul li{ float:left; } #nav ul li a{ display:block; } ãã¼ããã¬ã¼ã¹ã¨ã®çµ¡ã¿ããã£ã¦âã¯ãã§ã¤å¾®å¦ãªæ°ã¯â¦
URI#isAbsolute() ã¯URIãç¸å¯¾ã絶対ããå¤å®ããAPIã§ããããããã/foo/varãã¨ãã¯falseãè¿ãã®ãã»ã»ã»ã System.out.println( "http://foo/var : " + String.valueOf(new URI( "http://foo/var" ).isAbsolute())); System.out.println( "/foo/var : "â¦
ãcygpathãã使ãã°OKããaãã¯çµ¶å¯¾ãã¹ãè¿ãããã®ãªãã·ã§ã³ã§ãã $ cygpath -a ./å®è¡çµæã§ãã /cygdrive/c/Program Files/ Cygwinã§ã®ãã¹ãWindowsã®ãã¹ã«å¤æããã«ã¯ããwããªãã·ã§ã³ãä»ãã¾ãã $ cygpath -aw /cygdrive/c/Program\ Files/â¦
ARGFã¯å¼æ°ããªããã°æ¨æºå ¥åãããã¼ã¿ãèªã¿è¾¼ãã®ã§ãããã使ãã®ã楽ãªã®ããª?IOãªãã¸ã§ã¯ãæ´¾ç?ãªã®ã§ãreadã¨ãgetsã使ãã¾ãã以ä¸ã¯ãæ¨æºå ¥åã®ãã¼ã¿ãBase64ã§ã¨ã³ã³ã¼ããã¦åºåãããã£ã«ã¿ã®ä¾ã§ãã #!/bin/ruby puts [ARGF.read].pack(â¦
Regexp#unionã§è¤æ°ã®æ£è¦è¡¨ç¾ã®ããããä¸ã¤ã«ãããããæ£è¦è¡¨ç¾ãä½æã§ãã¾ãã reg = Regexp.union( /[a-c]+/, /[l-m]+/, /[x-z]+/ ) # 以ä¸ã¯ãã¹ã¦ãããããã puts reg =~ "aaa" puts reg =~ "bbb" puts reg =~ "ccc" puts reg =~ "lll" puts reg =â¦
ãã¢ããã¥ã¡ã³ããããã¾ããã%ã使ã£ã¦ãè¤æ°è¡æååãããã£ã¨å®ç¾©ã§ãã¾ãã puts %( è¤æ°è¡ã® æååã§ãã å¼å±éãããã¾ããâ#{1+1} ) å®è¡çµæã§ãã è¤æ°è¡ã® æååã§ãã å¼å±éãããã¾ããâ2èå¥åãèããªãã¦è¨ãå便å©ããã ãªããåãâ¦
$ man readã¨ã調ã¹ã¦ãã¦ãã¾ããæ°ãã¤ããã®ã ãã©ãbashã§ãprintfã使ããã®ãã $ printf "%s:%x" aaa 100000å®è¡çµæã§ãã aaa:186a0pwdã¨ãcdãbashã®æ©è½ãªã®ããã¸ã¼ã
ã%pãæ示åã§ãObject#inspectã®çµæãåºåãããã¨ãã§ãã¾ãã class Kitten def initialize( name, age ) @name = name @age = age end end puts Kitten.new( "mii", 3 ).to_s puts Kitten.new( "mii", 3 ).inspect puts "%p" % Kitten.new( "mii", 3 )â¦
yesã¯ãkillãããã¾ã§æå®ãããæååãåºåãç¶ããã³ãã³ãã§ãã使ãæ¹ã¯ä»¥ä¸ã $ yes <æåå>æååãçç¥ããã¨ãyããåºåããã¾ãã 使ãé éä¸ã§ãããããyãã®å ¥åãæ±ããããããã°ã©ã ãå®è¡ããã¨ãã«ä½¿ããããã $ yes | <yã®å ¥åãæ±ããããã³ãã³ã>ã¹ã¯ãªãããæ¸</yã®å ¥åãæ±ããããã³ãã³ã>â¦
ãvertical-align:middleãã§ç¸¦æ¹åä¸å¤®ãããã«ããè¦ç´ ã«floatãè¨å®ããã¨ãæ´åã解é¤ããã¦ãã¾ãããã¼ãè¦ç´ ãå·¦å³ã«é ç½®ãããªãfloatã ããªã¼ãä½ã¨ããªããããªãã¨ãããã¨ã§ãdivã使ã£ã¦ä½ã¨ããã¦ã¿ããæ¦ç¥ã¯ä»¥ä¸ã å³ã«ãããè¦ç´ ãdivã§å²â¦
String#%ã¯sprintfãªã®ãã puts "aaa %s ccc" % "bbb" å®è¡çµæã§ãã aaa bbb cccãµãã
ã°ã©ãã®è¨å®ãä¿åãããªãä¸å ·åã«ãã¾ããæ°ãã¤ããã®ã§ãä¿®æ£çããªãªã¼ã¹ãã¾ãã âGithub - unageanu/jiji âGemcutter.org - jijiGitHubã®gemãã«ãæ©è½ãå»æ¢ã«ãªã£ããããªã®ã§ãGemcutterã«ã¢ãããã¼ããã¦ãã¾ããgemã®ååããunagenau-jijiãââ¦
Gemcutterã¯ruby gemã®ãã¹ãã£ã³ã°ãµã¼ãã¹ã§ãã gemã®ãã¹ãã£ã³ã°ã®ã¿ã«ç¹åãããµã¼ãã¹ rubyforgeãGitHubã¨éã£ã¦ã½ã¼ã¹ã³ã¼ã管çãããã¸ã§ã¯ã管çã®æ©è½ã¯ãªããgemã®ãã¹ãã£ã³ã°ã®ã¿ã«ç¹åãããµã¼ãã¹ã§ããã·ã³ãã«ãªã¶ãã使ããããæãã§â¦
YUI.cachedã§ãä»»æã®é¢æ°ã«è©ä¾¡çµæã®ãã£ãã·ã¥æ©è½ãä»ä¸ãã¾ãããã£ãã·ã¥æ©è½ã追å ãããé¢æ°ã¯ãååè©ä¾¡æã®çµæã常ã«è¿ãããã«ãªãã¾ãã YUI().use( function(Y) { // ã©ã³ãã ãªå¤ãè¿ãé¢æ° var base = function(){ return Math.floor(Math.râ¦
YUI 3: Cacheã使ãã¨ãæå®ãããæ°ã ãã®è¦ç´ ãä¿æãããªã³ã¡ã¢ãªãã£ãã·ã¥ãä½æã§ãã¾ãã // ãã£ãã·ã¥ã使ããµã³ãã« YUI().use('cache', function(Y) { // ãã£ãã·ã¥æ°ã4ã«æå®ãã¦ãã£ãã·ã¥ãä½æã var cache = new Y.Cache({max:4}); // ãâ¦
$("#foo").text("${var}"); ã®å ´åãã${var}ãã«å«ã¾ããXMLã¨ã³ãã£ãã£ã¯ã¨ã¹ã±ã¼ãããªãã¦ããã¨ãã¦ãã"ããã'ãã¯ã\ãã§ã¨ã¹ã±ã¼ãããªãã¨JavaScriptçã«ãã¡ãªãã§ã¯ãã¨æã£ããVelocityã«ã¡ããã¨æ©è½ãç¨æããã¦ãã¾ããããã¨ãXMLã¨ã³ãã£â¦
ããããã£ã"eventhandler.referenceinsertion.class"ãã¨ã"eventhandler.escape.html.match"ããè¨å®ãããã¨ã§ãåãè¾¼ã¿æååå ã®XMLã¨ã³ãã£ãã£ã®ã¨ã¹ã±ã¼ã(ã<>&ãâã<>&ã)ãè¡ãªã£ã¦ããã¾ãã ããã©ã«ãã¯ä½ãããªãã®ã§ãæ示çã«è¨å®ããå¿ â¦
Class.getField()ã¯è¦ªã®staticå¤æ°ãæ¢ç´¢ãã¾ããä¾ãã°ã以ä¸ã®ã³ã¼ããå®è¡ããã¨ã Child.B,Child.C,Parent.Aã«ã¯å¤ãè¨å®ãããã Parent.Bã¯åæåãããªãã Child.Bãå ã«è¦ã¤ããã®ã§ãã¡ããè¿ããã¦ãã¾ãããã ã¨ããçµæã«ãªãã¾ãã public stâ¦
YUI 3: AsyncQueue ã使ãã¨ãæå®ããå¦çãé çªã«éåæå®è¡ãããã¥ã¼ãä½æã§ãã¾ããsetTimeoutã§ãªã¹ãã«è¿½å ãããé¢æ°ãé çªã«å®è¡ãããã¨ãã£ããåãããããããªã 以ä¸ã¯YUI 3: AsyncQueue ã使ã£ã¦æ¼ããããã¼ã表示ãããµã³ãã«ã§ããé«éã§â¦
YUI 3: DataSchema ã使ãã¨ãä»»æã®å½¢å¼ã®ãã¼ã¿ã解æãã¦JavaScriptã®ãªãã¸ã§ã¯ãã«å¤æãããã¨ãã§ãã¾ãã以ä¸ã¯DataSchema.Textã使ã£ã¦CSVããªãã¸ã§ã¯ãã®é åã«å¤æãããµã³ãã«ã§ãã // CSVå½¢å¼ã®æååã解æãããµã³ãã« YUI().use('datascheâ¦