Skip to content

Instantly share code, notes, and snippets.

View elimisteve's full-sized avatar
💭
Be more ambitious. The future depends on it.

Steve Phillips elimisteve

💭
Be more ambitious. The future depends on it.
View GitHub Profile
! Chromebook C720 ~/.Xmodmap
! Huan Truong - 2014
! = <1:Key> <2:Shift+Key> <3:mode_switch+Key> <4:mode_switch+Shift+Key> <5:AltGr+Key> <6:AltGr+Shift+Key> <7:Ctrl+Alt+Key>
! Clear both Alt keys mapping
clear Mod1
add mod1 = Alt_L
! Make the right alt key to be the mode switch key
keycode 108 = Mode_switch
@hubgit
hubgit / schema.xml
Created March 17, 2010 14:39
schema.xml for storing Wikipedia data in Solr
<?xml version="1.0" encoding="UTF-8" ?>
<schema name="wikipedia" version="1.2">
<types>
<fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true"/>
<fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
<fieldType name="text" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="1" splitOnCaseChange="0" splitOnNumerics="0" stemEnglishPossessive="1"/>
@0atman
0atman / post-receive
Created October 25, 2010 15:37
Simple git hook to auto deploy a django app to an 'unstable' testing server.
#!/bin/sh
#
# An example hook script that is called after a successful
# commit is made.
#
# To enable this hook, make this file executable.
echo "Starting auto-deploy..."
cd /usr/share/django
// Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"crypto/aes"
"crypto/cipher"
"compress/gzip"
@elazarl
elazarl / redcon.go
Created June 6, 2011 08:45
redirect network stream
package main
import (
"log"
"io"
"os"
"crypto/tls"
"strings"
"net"
"flag"
anonymous
anonymous / slowsort.go
Created October 6, 2011 19:33
Slow generic sorting
package slowsort
import (
"reflect"
"sort"
)
func Sort(sl interface{}, less interface{}) {
rsl := reflect.ValueOf(sl)
if rsl.Kind() != reflect.Slice {
anonymous
anonymous / db.go
Created January 24, 2012 17:39
Go SDK for Dropbox
package dropbox
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
"strconv"
@farnoy
farnoy / main.go
Created February 12, 2012 10:38
golang websockets
package main
import (
"websocket"
"http"
"fmt"
"io"
)
func EchoServer(ws *websocket.Conn) {
@krasin
krasin / hello_xml.go
Created March 29, 2012 06:45
An example of parsing XML in Go
package main
import (
"encoding/xml"
"fmt"
"log"
)
const data = `<Note>
<To>Tove</To>
@anandology
anandology / datetime_racecondition.py
Created May 9, 2012 10:33
Program to demonstrate a race condition in datetime module
"""I suspect that there is a race condition in datetime module.
When I ran the following code in a multi-threading application:
datetime.datetime.strptime('20120509100335', "%Y%m%d%H%M%S")
I've noticed the following error in the log.
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/threading.py", line 522, in __bootstrap_inner