Skip to content

Instantly share code, notes, and snippets.

@a7madgamal
a7madgamal / dark.md
Last active Oct 20, 2021
Dark mode for Slack on MacOS
View dark.md
@stewartpark
stewartpark / xor.py
Created Oct 12, 2015
Simple XOR learning with keras
View xor.py
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 Dec 7, 2014
Example golang code to access Elasticsearch using Thrift
View es-thrift.go
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 Jun 14, 2022
Simple Static File Server in Go
View serve.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
View mgoExample.go
package main
import (
"fmt"
"labix.org/v2/mgo"
"labix.org/v2/mgo/bson"
"time"
)
type Person struct {
@tpope
tpope / .gitattributes
Created Oct 24, 2010
Fewer conflicts in your Rails apps
View .gitattributes
Gemfile.lock merge=bundlelock
db/schema.rb merge=railsschema