This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| typeof null //Object, duh! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function twitterify($ret) { | |
| $ret = preg_replace("#(^|[\n ])([\w]+?://[\w]+[^ \"\n\r\t< ]*)#", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $ret); | |
| $ret = preg_replace("#(^|[\n ])((www|ftp)\.[^ \"\t\n\r< ]*)#", "\\1<a href=\"http://\\2\" target=\"_blank\">\\2</a>", $ret); | |
| $ret = preg_replace("/@(\w+)/", "<a href=\"http://www.twitter.com/\\1\" target=\"_blank\">@\\1</a>", $ret); | |
| $ret = preg_replace("/#(\w+)/", "<a href=\"http://search.twitter.com/search?q=\\1\" target=\"_blank\">#\\1</a>", $ret); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "3" + 1 // '31' | |
| "3" - 1 // 2 | |
| "222" - -"111" // "333" (⊙﹏⊙) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function laugh() | |
| { | |
| return | |
| { | |
| haha: "ha!" | |
| }; | |
| } | |
| laugh(); | |
| // returns undefined |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function sum( A ) { | |
| var result = 0; | |
| for(var i = 0;i < A.length;i++) { | |
| result += A[i] | |
| } | |
| return result | |
| } | |
| function equi ( A ) { | |
| var r = sum(A); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def equi(A): | |
| l, r = 0, sum(A) | |
| for i, e in enumerate(A): | |
| r -= e | |
| if l == r: | |
| return i | |
| l += e | |
| return -1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function equi ( $A ) { | |
| $total = array_sum($A); | |
| foreach($A as $key => $value){ | |
| if(($accumulated) == ($total - $accumulated - $value)){ | |
| return $key; | |
| } | |
| $accumulated += $value; | |
| } | |
| return -1; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Sounder sounds for class | |
| # Requires an active microphone to pick up anything | |
| require 'ruby-processing' | |
| class MinimTest < Processing::App | |
| load_library "minim" | |
| import "ddf.minim" | |
| import "ddf.minim.analysis" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| # -*- coding: utf-8 -*- | |
| require 'rubygems' | |
| require 'uri' | |
| require 'net/http' | |
| require 'digest/md5' | |
| require 'rexml/document' | |
| require 'extlib' | |
| require 'yaml' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function eliminarDuplicados(a) { | |
| var i, | |
| l = a.length, | |
| o = [], | |
| ob = {}; | |
| for (i = 0; i < l; i++) { | |
| ob[a[i]] = 0; | |
| } |