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 net = require('net'); | |
var server = net.createServer(function(socket) { | |
socket.on('data', function(data) { | |
socket.write(data); | |
var str = data.toString('utf8'); | |
if(str.indexOf('disconnect') !== -1) { | |
socket.end('goodbye\n'); |
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
net = require('net'); | |
var sockets = []; | |
var s = net.Server(function(socket) { | |
sockets.push(socket); | |
var index = sockets.indexOf(socket); | |
socket.on('data', function(d) { |
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
(tool-bar-mode) | |
(column-number-mode) | |
(scroll-bar-mode 0) | |
(blink-cursor-mode 0) | |
(set-cursor-color "dark grey") | |
;disable backup | |
(setq backup-inhibited t) | |
;disable auto save | |
(setq auto-save-default nil) |
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
<h2 class="demoHeaders">Radio buttons with icons</h2> | |
<div id="radioWithIcons"> | |
<input type="radio" id="radio1" name="radio" /><label for="radio1"><img src="http://www.google.com/favicon.ico"/> Choice 1</label> | |
<input type="radio" id="radio2" name="radio" checked="checked" /><label for="radio2"><img src="http://www.yahoo.com/favicon.ico"/> Choice 2</label> | |
<input type="radio" id="radio3" name="radio" /><label for="radio3"><img src="http://www.fogcreek.com/favicon.ico"/> Choice 3</label> | |
</div> | |
<script type="text/javascript"> | |
$(function(){ |
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> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> | |
<title>tiptip test</title> | |
<link type="text/css" href="tipTip.css" rel="stylesheet" /> | |
<link type="text/css" href="style.css" rel="stylesheet" /> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> | |
<script type="text/javascript" src="jquery.tipTip.minified.js"></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
from ctypes import * | |
msvcrt = cdll.msvcrt | |
message_string = "Hello world\n" | |
msvcrt.printf("Testing: %s", message_string) |
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
import time | |
from Xlib import X, display | |
while True: | |
d = display.Display() | |
s = d.screen() | |
root = s.root | |
a=root.query_pointer() | |
b=a._data | |
print b["root_x"], b["root_y"] |
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
package com.stackmob.mongoaddtoset | |
import com.mongodb._ | |
import org.bson.types.ObjectId | |
object MongoAddToSet extends App { | |
val conn = new Mongo("localhost", 27017) | |
val db = conn.getDB("addtoset") | |
val items = db.getCollection("items") |
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
package org.wkh.learningscala | |
case class GPFunction[T](f: List[T] => T, name: String) { | |
def apply(x: List[T]) = f(x) | |
override def toString = name | |
} | |
case class GPTerminal[T](f: Map[String, T] => T, name: String) { |
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
final Dummy dummy = new Dummy("Test 2 - Valdemar"); | |
StackMob.getLogger().setLogging(true); | |
final SimpleUser user = new SimpleUser("jonh", null); | |
user.fetchWithDepth(2, new StackMobCallback() { | |
@Override | |
public void success(String responseBody) { | |
StackMob.getLogger().logInfo("Response body when fetching: " + responseBody); |