Skip to content

Instantly share code, notes, and snippets.

@quchen
quchen / trolling_haskell
Last active November 12, 2024 00:10
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
@headius
headius / gist:5285216
Last active December 15, 2015 15:49
Alternate Clojure syntax (work in progress...and NOT an April Fool's joke)
The majority of parens in Clojure are redundant if we just say that all
n > 1 tokens in a line are arguments to the first token. Parens can be
added in a more C-style to disambiguate within a line. Newline plus
indent expands argument list over multiple lines and each of those
lines gets the original "one-line" treatment. Introducing an "ignore
indent" sigil allows sugaring up the structure. The majority of calls
can be expressed in one line with no parens at all.
Hello world:
@zmaril
zmaril / softwarehelpskill.md
Last active August 3, 2021 04:52
I want to write software that helps kill people.

I want to write software that helps kill people.

Please, before you call the police and get my github account put on lockdown, allow me a moment to explain. What I really want to do is work on projects that advance the human condition and improve people's lives. I've been in a mad dash to learn how to program for the past four or five years exactly because I realized how much good I could do for the world with a computer.

@sstephenson
sstephenson / super.bash
Last active January 30, 2017 01:40
`super` in Bash
#!/usr/bin/env bash
source super.bash
foo() {
echo hello
}
super_function foo
foo() {
@jlongster
jlongster / cloth-lljs.js
Last active December 16, 2015 03:29
large LLJS example
extern clear, fillRect, renderLine, print;
struct Vec2d {
function void Vec2d(float x, float y) {
this->x = x;
this->y = y;
}
float x;

Arguments Against Promises for Promises

The argument for avoiding promises for promises is fairly simple. A promise is a representation of a value that will exit in the future. If that value is still a promise, you haven't really got to the final value yet. Conceptually having the promise doesn't really provide anything other than a means to obtain the final value, as such it's of no additional use to be able to get the intermediate nested promises: You might as well just jump straight to the value.

The "JQPFAQPFAWJPFADFFAN" Problem

This problem is explained in more detail by @erights here. The currently proposed [[Resolve]] algorithm only dictates this recursive flattening for unrecognised thenables, not for promises. THe advantage of this behavior is that a user can pick up a Promises/A+ library and return a deeply nested mess of foreign promises objects (all of which were broken enough not to do any unwrappi

@heath
heath / es6-map.js
Last active December 16, 2015 17:38
Maps in various languages
[1,2,3].map((n)=> n*2)
@zeevallin
zeevallin / production.rb
Last active December 17, 2015 05:08
It should be quite similar using AWS insted of rackspace
# Enable serving of images, stylesheets, and JavaScripts from an asset server
config.action_controller.asset_host = "https://c776950.ssl.cf2.rackcdn.com"
@robotlolita
robotlolita / 0.md
Last active December 17, 2015 05:39
A short introduction to CommonJS modules

So you want to use modules? Modules in CommonJS are just files. So if you want a module, the first thing you should create is yourAwesomeModule.js

You'll need Node.js and, if you want to support browsers, you'll need Browserify

@tenderlove
tenderlove / terrible.rb
Last active May 16, 2020 13:13
I am a terrible person
require 'fiddle'
module IAmAHorriblePerson
def unset flag
value = _wrap self
flags = 8.times.map { |i| value[i] }.pack('C8').unpack('Q').first
[flags & ~flag].pack('Q').unpack('C8').each_with_index { |n,i|value[i] = n }
end
def class= k