Skip to content

Instantly share code, notes, and snippets.

@danfishgold
danfishgold / ElmWarrior.elm
Last active Jun 17, 2020
for the london elm meetup on June 17th, 2020
View ElmWarrior.elm
module Player exposing (takeTurn)
import Set exposing (Set)
import Warrior exposing (Warrior)
import Warrior.Coordinate exposing (Coordinate)
import Warrior.Direction exposing (Direction(..))
import Warrior.History as History exposing (History)
import Warrior.Map as Map exposing (Map)
import Warrior.Map.Tile exposing (..)
View muse.py
# encoding: utf-8
'''
Connect the muse to the computer with BT.
use muse-io (in the command line) to read data from the muse thing.
with --osc 'osc.tcp://localhost:4999' because the default is port 5000 and
it won't work if there's another process on that port. port 4999 was fine.
read the data with muse-player. pass the port through '-l 4999'.
@danfishgold
danfishgold / block_fake_followers.py
Created Oct 15, 2015
Use this to block fake followers. You need to find an account that the fake users are all following
View block_fake_followers.py
'''
This is a python script to block those extra fake followers.
Here's what you have to do:
# Twitter Authorization
1. Go to apps.twitter.com
2. Click on Create New App
3. Fill in the stuff. None of it matters
@danfishgold
danfishgold / SecretSanta.swift
Last active Sep 25, 2015
My dirty 2:30 AM solution for the Omni Group’s Swift Bike Shedding Club week two question: http://rubyquiz.com/quiz2.html (via Brent)
View SecretSanta.swift
/*
sort families by their size. (let's name them A, B, C, D, and E.)
(if the biggest family is over half of the enitre group there's no valid solution.)
while A.count > B.count
pair up santas from A (the biggest family) and E (the smallest)
(e.g., Dan A is Brent E's santa and vice versa)
while there are still unmatched people
make loops of people
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
width: 960px;
height: 500px;
position: relative;
}
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
width: 960px;
height: 500px;
position: relative;
}
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
width: 960px;
height: 500px;
position: relative;
}