Skip to content

Instantly share code, notes, and snippets.

@a7madgamal
a7madgamal / dark.md
Last active July 14, 2023 04:00
Dark mode for Slack on MacOS
@stewartpark
stewartpark / xor.py
Created October 12, 2015 08:17
Simple XOR learning with keras
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation
from keras.optimizers import SGD
import numpy as np
X = np.array([[0,0],[0,1],[1,0],[1,1]])
y = np.array([[0],[1],[1],[0]])
model = Sequential()
model.add(Dense(8, input_dim=2))
@stuart-warren
stuart-warren / es-thrift.go
Created December 7, 2014 22:41
Example golang code to access Elasticsearch using Thrift
package main
/*
* Example golang code to access Elasticsearch using Thrift
* gen-go directory generated with:
* ``thrift -gen go elasticsearch.thrift``
*/
import (
"fmt"
"git.apache.org/thrift.git/lib/go/thrift"
"github.com/stuart-warren/es-thrift/gen-go/elasticsearch" // generated code
@paulmach
paulmach / serve.go
Last active March 28, 2024 15:31
Simple Static File Server in Go
/*
Serve is a very simple static file server in go
Usage:
-p="8100": port to serve on
-d=".": the directory of static files to host
Navigating to http://localhost:8100 will display the index.html or directory
listing file.
*/
package main
@border
border / mgoExample.go
Created August 27, 2012 15:33
mgo example
package main
import (
"fmt"
"labix.org/v2/mgo"
"labix.org/v2/mgo/bson"
"time"
)
type Person struct {
@tpope
tpope / .gitattributes
Created October 24, 2010 20:38
Fewer conflicts in your Rails apps
Gemfile.lock merge=bundlelock
db/schema.rb merge=railsschema