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
| // The following script will hang on V8 regex engine. (It works fine on Safari Mac). | |
| // Regex was taken from https://gist.github.com/gruber/249502 | |
| "http://www.ghislainproulx.net/Blog/2014/09/contributing-to-a-github-open-source-project-(from-a-visual-studio-developer-perspective)".replace(/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/gi, function(url){ | |
| // this will never be executed on Chrome/Node | |
| console.log(url); | |
| }); | |
| // Checkout your CPU consumption ! |
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
| // Cleaner approach than setInterval + click. | |
| var t = angular.element(document.querySelector('.reaction-time-test')).scope().test; | |
| t.trials = Array.apply(null, new Array(5)).map(function(a){ | |
| var trial = t.nextTrial(); | |
| trial.result = 100; | |
| trial.timeWaited = 3000+~~(Math.random() * 1000); | |
| return trial; | |
| }); | |
| t.save(); |
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
| /** | |
| * How to automatically vote on VoicePolls -__- #ScriptKiddieLevel | |
| * | |
| * Guys, you should really check — at least — for IPs and — at least — put a rate-limit on API calls. | |
| * | |
| * Usage : | |
| * $ npm install async request | |
| * $ node vote.js | |
| */ |
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
| for file in ./*.MTS | |
| do | |
| ffmpeg -i $file -vcodec mjpeg -b 100M -acodec pcm_s16be $file.mov | |
| done |
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
| var a=new GameManager(4, KeyboardInputManager, HTMLActuator, LocalScoreManager); | |
| a.won=!0; | |
| a.score=32768; | |
| a.actuate(); |
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
| // First configure $animateProvider | |
| angular.module('MyApp', ['ngAnimate']).config(['$animateProvider', function($animateProvider){ | |
| // restrict animation to elements with the bi-animate css class with a regexp. | |
| // note: "bi-*" is our css namespace at @Bringr. | |
| $animateProvider.classNameFilter(/bi-animate/); | |
| }]); |
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
| # On host 1 (from where "nodetool -h somewhereelse" was run) | |
| ls -ls /usr/share/cassandra/*.jar | |
| 3304 -rw-r--r-- 1 cassandra cassandra 3380834 Jan 13 21:12 /usr/share/cassandra/apache-cassandra-2.0.4.jar | |
| 0 lrwxrwxrwx 1 cassandra cassandra 26 Jan 13 21:12 /usr/share/cassandra/apache-cassandra.jar -> apache-cassandra-2.0.4.jar | |
| 1816 -rw-r--r-- 1 cassandra cassandra 1855571 Jan 13 21:12 /usr/share/cassandra/apache-cassandra-thrift-2.0.4.jar | |
| 80 -rw-r--r-- 1 cassandra cassandra 78965 Jan 13 21:12 /usr/share/cassandra/stress.jar | |
| # On host 2 (somewhereelse) | |
| ls -ls /usr/share/cassandra/*.jar | |
| 3192 -rw-r--r-- 1 cassandra cassandra 3265362 Sep 5 20:26 /usr/share/cassandra/apache-cassandra-2.0.0.jar |
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
| Exception in thread "main" java.io.IOException: java.lang.reflect.UndeclaredThrowableException | |
| at org.apache.cassandra.tools.NodeProbe.forceRepairAsync(NodeProbe.java:230) | |
| at org.apache.cassandra.tools.NodeCmd.optionalKSandCFs(NodeCmd.java:1502) | |
| at org.apache.cassandra.tools.NodeCmd.main(NodeCmd.java:1221) | |
| Caused by: java.lang.reflect.UndeclaredThrowableException | |
| at com.sun.proxy.$Proxy0.forceRepairAsync(Unknown Source) | |
| at org.apache.cassandra.tools.RepairRunner.repairAndWait(NodeProbe.java:1019) | |
| at org.apache.cassandra.tools.NodeProbe.forceRepairAsync(NodeProbe.java:225) | |
| ... 2 more | |
| Caused by: javax.management.ReflectionException: Signature mismatch for operation forceRepairAsync: (java.lang.String, boolean, java.util.Collection, boolean, [Ljava.lang.String;) should be (java.lang.String, boolean, boolean, boolean, [Ljava.lang.String;) |
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 print[A](params:A*) = params.foreach(println) | |
| // Below, every call to our print function are equivalent | |
| // apply an array of arguments | |
| val params = Seq(1,2,3) | |
| print(params: _*) | |
| // apply an array of arguments | |
| print(Seq(1,2,3): _*) |
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
| import sbt._ | |
| import Keys._ | |
| import play.Project._ | |
| object ApplicationBuild extends Build { | |
| System.setProperty("http.port", "9001") | |
| // this setting can be overriden with `play "run 9002"` | |
| // ... | |
| } |