Skip to content

Instantly share code, notes, and snippets.

🌴
On vacation

Alexis Sellier cloudhead

View GitHub Profile
View gist:07a231a433c6dc6d63b1b7c40911a178
### Keybase proof
I hereby claim:
* I am cloudhead on github.
* I am cloudhead (https://keybase.io/cloudhead) on keybase.
* I have a public key whose fingerprint is 9453 A236 6051 325A 9983 4A19 0F08 5776 FC21 7A78
To claim this, I am signing this object:
View wtf.go
package main
type Error struct {
Err error
}
func (e *Error) Error() string {
return e.Err.Error()
}
View nextFreeSlot.hs
newtype Inventory = Inventory (IntMap (Maybe Item))
nextFreeSlot :: Inventory -> Maybe IntMap.Key
nextFreeSlot (Inventory inv) =
go $ IntMap.toAscList inv
where
go ((k, Nothing) : _) = Just k
go [] = Nothing
go (_ : xs) = go xs
@cloudhead
cloudhead / bqueue.go
Created Aug 7, 2013
Blocking queue implementation
View bqueue.go
package queue
import "sync"
type Message string
type Queue struct {
wmu sync.Mutex
cmu sync.Mutex
slice []*Message
@cloudhead
cloudhead / gist:5885445
Created Jun 28, 2013
cloudhead's ASCII Emoticons
View gist:5885445
# cloudhead's ASCII Emoticon reference
T,T Q,Q T_T # Crying face
^,^ ^_^ # Happy face
<,< <_< # Uncertain or hesitant face
V,V V_V # Tired uncertain face, also "Sighing" face
*,* *_* # Exhausted face/Too much computer face
@,@ @_@ # Hangover face
o,o O,O # Surprised face
^.^ # Happy dog face
View gist:3402849
#!/bin/sh
set -xeo pipefail
eval $1 | eval $2
View other.go
package main
func main() {
println("starting..")
go func() {
println("hello") // This never prints
}()
for {}
View gist:1933613

Variadic argument support in LESS 1.3.0

.mixin (...) {        // matches 0-N arguments
.mixin () {           // matches exactly 0 arguments
.mixin (@a: 1) {      // matches 0-1 arguments
.mixin (@a: 1, ...) { // matches 0-N arguments
.mixin (@a, ...) {    // matches 1-N arguments
@cloudhead
cloudhead / gist:1677036
Created Jan 25, 2012
Go in < 140 characters
View gist:1677036

Go in < 140 characters

if err != nil {
    return
}
@cloudhead
cloudhead / gist:1591794
Created Jan 10, 2012
LESS 1.2.0 CHANGELOG
View gist:1591794

LESS 1.2.0 CHANGELOG

  • mixin guards
  • new function percentage
  • new color function to parse hex color strings
  • new type-checking stylesheet functions
  • fix Rhino support
  • fix bug in string arguments to mixin call
  • fix error reporting when index is 0
  • fix browser support in webkit and IE
You can’t perform that action at this time.