Skip to content

Instantly share code, notes, and snippets.

View micrypt's full-sized avatar

Seyi Ogunyemi micrypt

View GitHub Profile
@micrypt
micrypt / News feed.
Created May 9, 2012 19:10
GitHub made new icons… but they made my eyes hurt a wee bit. [ sad panda ]
.news .alert .mini-icon.push,
.news .alert .mini-icon.pull-request,
.news .alert .mini-icon.watching,
.news .alert .mini-icon.issue-comment,
.news .alert .mini-icon.create,
.news .alert .mini-icon.follow,
.news .alert .mini-icon.fork,
.news .alert .mini-icon.issue-closed,
.news .alert .mini-icon.issue-opened,
.news .alert .mini-icon.wiki {
@micrypt
micrypt / Cocoa.md
Created February 24, 2012 01:33 — forked from HedgeMage/Cocoa.md
HedgeMage's famous low-carb hot cocoa recipe

Saucepan directions (preferred)

Ingredients:

  • 10oz. heavy whipping cream
  • 1 tbsp. dutch-processed cocoa powder (if this comes out too strong for you, try regular cocoa powder instead, or adjust the amount)
  • 1/2 tsp. vanilla extract
  • Water
  • Honey
  • add-in of choice (I like to top with whipped cream)
@micrypt
micrypt / xkcd-downloader.hs
Created February 21, 2012 23:24
Download xkcd comics using STM
{-# Language PackageImports #-}
module Main where
import Control.Monad (liftM, forM_, replicateM_)
import Control.Concurrent (forkIO)
import Control.Concurrent.STM
import "mtl" Control.Monad.Error
import Control.Applicative
import Control.Exception
import qualified Network.Stream as Stream (Result)
//This wee bit o' CoffeeScript
editor = CodeMirror.fromTextArea(document.getElementById('id_body'),
mode: "markdown"
lineNumbers: false
lineWrapping: true
onCursorActivity: () ->
setLineClass(hlLine, null)
hlLine = editor.setLineClass(editor.getCursor().line, "activeline"))
@micrypt
micrypt / translation_notes.clj
Created February 7, 2012 01:58
SICP Clojure notes
;; Iterative count
(defn count [sent]
(defn iter [wds result]
(if (empty? wds)
result
(iter (rest wds) (+ 1 result))))
(iter sent 0))
@micrypt
micrypt / dabblet.css
Created January 24, 2012 11:56 — forked from daneden/dabblet.css
Light loader
/**
* Light loader
*/
* {
margin: 0;
padding: 0;
}
html {
@micrypt
micrypt / twitter-user-stylesheet.css
Created December 22, 2011 17:16 — forked from adactio/twitter-user-stylesheet.css
CSS rules to hide "Discover", "Trending Topics", "Who To Follow" and specific people on new new Twitter.
[data-component-term="trends"] *,
[data-component-term="user_recommendations"] *,
[data-component-term="discover_nav"] *,
[data-screen-name="username"] * {
display: none !important;
}
@micrypt
micrypt / permutationgame
Created November 13, 2011 11:12
Puzzles
Permutation Game (30 Points)
Alice and Bob play the following game:
1) They choose a permutation of the first N numbers to begin with.
2) They play alternately and Alice plays first.
3) In a turn, they can remove any one remaining number from the permutation.
4) The game ends when the remaining numbers form an increasing sequence. The person who played the last turn (after which the sequence becomes increasing) wins the game.
Assuming both play optimally, who wins the game?
Input:
The first line contains the number of test cases T. T test cases follow. Each case contains an integer N on the first line, followed by a permutation of the integers 1..N on the second line.
Output:
@micrypt
micrypt / Cake
Created October 29, 2011 14:46
Barcamp London talks
Notes -
Try to get softer butter as it's easier to work with.
Don't overmix. If you do it might cause the cake to not rise properly.
If your cake it golden, then it's done.
Get a torch to if your oven doesn't have a light in it as you don't want to repeatedly open your oven to see how your cake is doing as it let the heat escape.
@micrypt
micrypt / Combinations_in_J.j
Created October 7, 2011 23:59
Combinations - In essence: "The problem is one of turning a list of values, say, [A, B, C, D] into a list of pairs with itself, like so [[A,B], [A,C], [A,D], [B, C], [B,D], [C,D]]."
a = 'abcd'
comb=: 4 : 0
k=. i.>:d=.y-x
z=. (d$<i.0 0),<i.1 0
for. i.x do. z=. k ,.&.> ,&.>/\. >:&.> z end.
; z
)
(2 comb #a) { a