This file contains 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
/// Make this script available somewhere | |
var extendsClass = this.extendsClass || function (d, b) { | |
function __inheritedProto() { this.constructor = d; } | |
__inheritedProto.prototype = b.prototype; | |
d.prototype = new __inheritedProto(); | |
} | |
/// Sample class 1 | |
var CLASS = (function() { | |
function CLASS(data) { |
This file contains 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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace System.Linq | |
{ | |
public static class IEnumerableExtensionForEach | |
{ | |
public static void ForEach<T>(this IEnumerable<T> list, Action<T> block) { |
This file contains 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
class YourSingletonClass { | |
public static synchronized YourSingletonClass getInstance() { | |
if (instance == null) { | |
instance = new YourSingletonClass(); | |
} | |
return instance; | |
} | |
public Object clone() throws CloneNotSupportedException { | |
throw new CloneNotSupportedException(); |
This file contains 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/python | |
import sys | |
def main(): | |
print 'Hello there', sys.argv[1] | |
if __name__ == '__main__': | |
main() |
This file contains 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
<script src="/socket.io/socket.io.js"></script> | |
<script> | |
var socket = io.connect('http://localhost'); | |
socket.on('channel1', function (data) { | |
console.log(data); | |
socket.emit('channel2', { other: 'message' }); | |
}); | |
</script> |
This file contains 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 io = require('socket.io').listen(process.env.PORT || 80); | |
io.sockets.on('connection', function (socket) { | |
socket.emit('channel1', { data: 'value' }); | |
socket.on('channel2', function (data) { | |
console.log(data); | |
}); | |
}); |
This file contains 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 NAMESPACE = NAMESPACE = NAMESPACE || {}; | |
This file contains 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
#include <iostream> | |
int main() | |
{ | |
std::cout << "Implement me!" << std::endl; | |
return 0; | |
} |
This file contains 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
/* | |
Description | |
*/ | |
void setup() | |
{ | |
} | |
void loop() | |
{ |
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<link rel="stylesheet" href="" type="text/css"> | |
<meta charset=utf-8 /> | |
<title></title> | |
</head> | |
<body> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> |
NewerOlder