Skip to content

Instantly share code, notes, and snippets.

View cloudhead's full-sized avatar
🌴
On vacation

Alexis Sellier cloudhead

🌴
On vacation
View GitHub Profile
@benshimmin
benshimmin / gist:8da42a687eae6e47f30d
Last active August 29, 2015 14:09
"Look at love" - Rumi
look at love
how it tangles
with the one fallen in love
look at spirit
how it fuses with earth
giving it new life
why are you so busy
with this or that or good or bad
@ThisIsMissEm
ThisIsMissEm / gist:242732
Created November 25, 2009 14:18
A very basic daemon for Node.js
#! /bin/sh
CUR_DIR=$PWD
PID_FILE="$CUR_DIR/node.pid"
if [ $1 = "start" ]; then
if [ -e $PID_FILE ]; then
echo "Node.js is already running."
else
echo "Starting Node Server"
// Based on http://bit.ly/215MBZ
function FailureDetector(ws) {
// ws stands for window size.
// How many heartbeat intervals we keep track of.
this.ws = ws || 100;
this.window = [];
this.last = null;
}
exports.FailureDetector = FailureDetector;
/*
A simple new-line delimited JSON protocol with upgrades.
Receiving Usage:
protocol = require('./frame-protocol');
// parsing data
parser = protocol.Parser();
@cloudhead
cloudhead / gist:967157
Created May 11, 2011 19:38
LESS v1.1.0 - What's new

LESS v1.1.0 - What's new

@arguments special variable:

  .box-shadow () { -webkit-box-shadow: @arguments }

string interpolation:

content: "hello @{var}"; // replaced with value of @var

@z0r0z
z0r0z / Multisig.sol
Last active March 9, 2022 01:50
Simple gas-optimized multi-signature contract.
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.4;
/// @notice Simple gas-optimized multi-signature contract.
contract Multisig {
event Propose(address indexed proposer, uint256 indexed proposal);
event Sign(address indexed signer, uint256 indexed proposal);
event Execute(uint256 indexed proposal);
error NotSigner();
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
import Control.Monad.IO.Class
import Control.Monad.Trans.Class
import Prelude hiding (log)
--------------------------------------------------------------------------------
-- The API for cloud files.
class Monad m => MonadCloud m where
saveFile :: Path -> Bytes -> m ()
@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
@matthewmueller
matthewmueller / osx-for-hackers.sh
Last active April 21, 2024 03:30
OSX for Hackers (Mavericks/Yosemite)
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront