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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 python | |
# Reflects the requests from HTTP methods GET, POST, PUT, and DELETE | |
# Written by Nathan Hamiel (2010) | |
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler | |
from optparse import OptionParser | |
class RequestHandler(BaseHTTPRequestHandler): | |
def do_GET(self): |
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
package main | |
import ( | |
"log" | |
"net/http" | |
"syscall" | |
"unsafe" | |
) | |
func main() { |
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
package com.salesforce.chatter.provider; | |
import android.content.ContentResolver; | |
import android.content.ContentValues; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.content.UriMatcher; | |
import android.database.Cursor; | |
import android.database.MatrixCursor; | |
import android.database.MatrixCursor.RowBuilder; |
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
## {{{ http://code.activestate.com/recipes/491264/ (r4) | |
import socket | |
class DNSQuery: | |
def __init__(self, data): | |
self.data=data | |
self.dominio='' | |
tipo = (ord(data[2]) >> 3) & 15 # Opcode bits | |
if tipo == 0: # Standard query |
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
public class JSON2Java { | |
private static final ScriptEngine jsonParser; | |
static { | |
try { | |
String init = read(JSON2Java.class.getResource("json2java.js")); | |
ScriptEngine engine = new ScriptEngineManager().getEngineByName("JavaScript"); | |
engine.eval(init); | |
jsonParser = engine; |
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
public Object list(@Param("page") int page, @Param("rows") int rows, @Param("..") Action obj) { | |
if (rows < 1) | |
rows = 10; | |
if (page < 1) { | |
page = 1; | |
} | |
// build SQL Where | |
XsqlBuilder builder = new XsqlBuilder(); | |
Map<String, Object> filters = new HashMap<String, Object>(); |