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 android.util.Base64; | |
import android.util.Log; | |
import com.bugsnag.android.Bugsnag; | |
import com.bugsnag.android.MetaData; | |
import com.bugsnag.android.Severity; | |
import com.facebook.react.bridge.*; | |
import java.io.File; | |
import java.io.InputStream; |
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
// Swift 2.0 | |
/* Function composition operator */ | |
infix operator •> { associativity left precedence 150 } | |
func •> <A,B,C> (f:A -> B, g:B -> C ) -> A -> C { | |
return { g(f($0)) } | |
} | |
extension Array where T: IntegerType { | |
func sum() -> T { |
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
# application_controller.rb | |
before_filter :handle_cors | |
def handle_cors | |
if env.keys.include? "HTTP_ORIGIN" | |
response.headers['Access-Control-Allow-Origin'] = 'http://www.myapp.com' | |
end | |
end |
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
/* | |
* Little example of how to use ```socket-io.client``` and ```request``` from node.js | |
* to authenticate thru http, and send the cookies during the socket.io handshake. | |
*/ | |
var io = require('socket.io-client'); | |
var request = require('request'); | |
/* | |
* This is the jar (like a cookie container) we will use always |
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
/* | |
taken from http://www.dustindiaz.com/top-ten-javascript | |
*/ | |
function getElementsByClass(searchClass,node,tag) { | |
var classElements = new Array(); | |
if ( node == null ) | |
node = document; | |
if ( tag == null ) | |
tag = '*'; | |
var els = node.getElementsByTagName(tag); |
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
games = ["Super Mario Bros.", "Contra", "Metroid", "Mega Man 2"] | |
puts "Games in your vast collection: #{games.count}" unless games.empty? | |
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
NSDateFormatter* dateFormatter = [[NSDateFormatter alloc] init]; | |
[dateFormatter setDateStyle:NSDateFormatterShortStyle]; | |
NSLog(@"now: %@", [dateFormatter stringFromDate:[NSDate date]]); |
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
while true | |
do | |
echo -n "Please confirm (y or n) :" | |
read confirm | |
case $confirm in | |
y|Y|YES|yes|Yes) | |
break | |
;; | |
n|N|no|NO|No) | |
echo Aborting - you entered $confirm |
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
<html> | |
<head> | |
<title>Interactive Line Graph</title> | |
<script src="http://d3js.org/d3.v2.js"></script> | |
<!-- | |
using JQuery for element dimensions | |
This is a small aspect of this example so it can be removed fairly easily if needed. | |
--> | |
<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script> | |
<script src="sample_data.js"></script> |
NewerOlder