Skip to content

Instantly share code, notes, and snippets.

@banksean
banksean / perlin-noise-classical.js
Created February 15, 2010 10:00
two Perlin noise generators in javascript. The simplex version is about 10% faster (in Chrome at least, haven't tried other browsers)
// Ported from Stefan Gustavson's java implementation
// http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf
// Read Stefan's excellent paper for details on how this code works.
//
// Sean McCullough banksean@gmail.com
/**
* You can pass in a random number generator object if you like.
* It is assumed to have a random() method.
*/
@felixge
felixge / 10-ways-to-improve-github-issues.md
Created April 13, 2011 13:02
I love the new GitHub issues, here are some ideas to make it perfect, ordered by priority:

10 Ways to improve Github Issues

I love the new GitHub issues, here are some ideas to make it perfect, ordered by priority:

1. I should be able to pick the assignee and milestone via keyboard when creating a new ticket

2. Keyboard shortcuts should work everywhere. E.g. when viewing an existing issue, 'c' does not work.

3. After creating an issue, the assigned user / milestone should be remembered and pre-filled.

4. Allow assigning a different user while commenting. Right now this deletes my half-typed comment.

5. When typing the @ symbol to mention somebody, it should auto-complete the name.

6. Things feel a little sluggish right now, any speed improvements would be very welcome.

@ssokolow
ssokolow / .Xresources
Created May 1, 2011 15:54
.Xresources settings for more modern XTerm keybindings
! {{{ Quick Reference
!
! Scrolling:
! Scroll Wheel
! Shift-PgUp/PgDn
!
! Copy/Paste:
! Mouse-Select : Copy to PRIMARY
! Shift + Mouse-Select: Copy to CLIPBOARD
!
@basvandijk
basvandijk / TaglessSerialization.hs
Created September 8, 2012 10:31
Tagless, Applicative, bidirectional serialization combinators
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE MultiParamTypeClasses #-}
import Control.Applicative
class Field a where
fieldType :: a -> String
fieldRead :: String -> a
@sjoerdvisscher
sjoerdvisscher / ADTShow.hs
Created September 9, 2012 14:57
Applicative, bidirectional serialization combinators
{-# LANGUAGE
RankNTypes
, TypeFamilies
, ConstraintKinds
, FlexibleInstances
, ScopedTypeVariables
, TypeSynonymInstances
#-}
import GHC.Prim (Constraint)
@tonymorris
tonymorris / TypeClass.hs
Last active September 15, 2020 13:17
Type-class hierarchy
Moved to https://github.com/tonymorris/type-class
@ihashacks
ihashacks / notifyosd.zsh
Last active November 7, 2021 18:01
pseudo undistract-me implementation in zsh Original undistract-me: http://mumak.net/undistract-me/
# commands to ignore
cmdignore=(htop tmux top vim)
# end and compare timer, notify-send if needed
function notifyosd-precmd() {
retval=$?
if [[ ${cmdignore[(r)$cmd_basename]} == $cmd_basename ]]; then
return
else
if [ ! -z "$cmd" ]; then
@snoyberg
snoyberg / test.xml
Created February 11, 2013 16:52
xml-conduit + lens
<foo>
<bar>
<baz>
<bin/>
</baz>
</bar>
<bar/>
</foo>
@quchen
quchen / trolling_haskell
Last active February 24, 2024 01:30
Trolling #haskell
13:15 <xQuasar> | HASKELL IS FOR FUCKIN FAGGOTS. YOU'RE ALL A BUNCH OF
| FUCKIN PUSSIES
13:15 <xQuasar> | JAVASCRIPT FOR LIFE FAGS
13:16 <luite> | hello
13:16 <ChongLi> | somebody has a mental illness!
13:16 <merijn> | Wow...I suddenly see the error of my ways and feel
| compelled to write Node.js!
13:16 <genisage> | hi
13:16 <luite> | you might be pleased to learn that you can compile
| haskell to javascript now
@fawda123
fawda123 / gar_fun.r
Last active September 3, 2021 16:32
gar_fun
gar.fun<-function(out.var,mod.in,bar.plot=T,struct=NULL,x.lab=NULL,
y.lab=NULL, wts.only = F){
require(ggplot2)
require(plyr)
# function works with neural networks from neuralnet, nnet, and RSNNS package
# manual input vector of weights also okay
#sanity checks