Skip to content

Instantly share code, notes, and snippets.

View danbri's full-sized avatar

Dan Brickley danbri

View GitHub Profile
require 'rubygems'
require 'gsl'
users = { 1 => "Ben", 2 => "Tom", 3 => "John", 4 => "Fred" }
m = GSL::Matrix[
#Ben, Tom, John, Fred
[5,5,0,5], # season 1
[5,0,3,4], # season 2
[3,4,0,3], # season 3
[0,0,5,3], # season 4
@premasagar
premasagar / tim.js
Created August 12, 2010 17:52
A tiny, secure JavaScript micro-templating script. It doesn't use eval or (new Function), so it cannot execute malicious code.
/*
== Tim ==
A tiny, secure JavaScript micro-templating script.
This has now moved to:
github.com/premasagar/tim
*/
@lubomir
lubomir / Iris.hs
Created January 10, 2014 13:41
Part 3 of final assignment for Complex Valued Neural Networks with Multi Valued Neurons course
module Iris where
import Data.Vector (Vector)
import Control.Arrow
import qualified Data.Vector as V
import Data.Complex
learning :: Vector (Vector (Complex Double), Int)
learning = V.fromList $ map (first $ V.fromList . map cis)
[ ([0.31, 0.873, 0.095, 0.058], 0)
@lambdazen
lambdazen / SchemaChecker.groovy
Last active June 29, 2018 20:32
Quick and Dirty Groovy/Gremlin Schema Checker
// You can run this code in a Gremlin shell. Tested with Tinkerpop 2.4.0
// A sample graph -- See https://github.com/tinkerpop/blueprints/wiki/Property-Graph-Model
g = TinkerGraphFactory.createTinkerGraph()
// The schema for the sample graph -- See http://lambdazen.blogspot.com/2014/01/do-property-graphs-have-schemas.html
sg = new TinkerGraph()
person = sg.addVertex()
person.setProperty('_label', 'person')
person.setProperty('name', 'java.lang.String')
person.setProperty('age', 'java.lang.Integer')
@kazad
kazad / fourier.html
Created June 25, 2014 19:00
BetterExplained Fourier Example
<html>
<head>
<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.2/underscore-min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script>
<script src="//ajax.cdnjs.com/ajax/libs/json2/20110223/json2.js"></script>
<!--
TODO:
@syhw
syhw / dnn.py
Last active January 24, 2024 19:38
A simple deep neural network with or w/o dropout in one file.
"""
A deep neural network with or w/o dropout in one file.
License: Do What The Fuck You Want to Public License http://www.wtfpl.net/
"""
import numpy, theano, sys, math
from theano import tensor as T
from theano import shared
from theano.tensor.shared_randomstreams import RandomStreams
@ewg118
ewg118 / nomisma-images
Created February 24, 2015 22:21
Nomisma SPARQL images
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX dcmitype: <http://purl.org/dc/dcmitype/>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
PREFIX nm: <http://nomisma.org/id/>
PREFIX nmo: <http://nomisma.org/ontology#>
PREFIX org: <http://www.w3.org/ns/org#>
PREFIX osgeo: <http://data.ordnancesurvey.co.uk/ontology/geometry/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
@danbri
danbri / README.md
Last active May 8, 2024 15:07 — forked from fabiovalse/README.md
Schema.org hierarchy Sunburst
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
I fed https://twitter.com/generativist/status/1525483961249669122
to https://beta.openai.com/playground
SCREENPLAY DRAFT
Elevator pitch:
stars are conscious and communicate with other stars in a way we don't recognize because their timescales are too long for us to even think about.
then someone figures it out.