This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# compdb/BUCK | |
python_bootstrap_binary( | |
name = "combine_compdbs", | |
main = "combine_compdbs.py", | |
visibility = ["PUBLIC"] | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<canvas id="canvas" width="256" height="256" /> | |
<script> | |
const canvas = document.getElementById('canvas'); | |
const ctx = canvas.getContext('2d'); | |
ctx.fillStyle = 'black'; | |
ctx.fillRect(0, 0, 256, 256); | |
ctx.fillStyle = 'white'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Clock = { | |
include ReactRe.Component.Stateful; | |
let name = "Clock"; | |
type props = (); | |
type state = {now: Js_date.t, timerID: option Js_global.intervalId}; | |
let getInitialState () => { | |
{ now: Js_date.make (), timerID: None }; | |
}; |
Say we want to spin off threads every so often, but we also need the ability to wait until they all go away before exiting the application.
In Haskell, we can do this naive thing:
main = do
count <- newTVarIO 0
let spawnThread action = do
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::ops::{Add, Sub}; | |
#[derive(Copy, Debug)] | |
pub struct Rect<T> { | |
pub left: T, | |
pub top: T, | |
pub right: T, | |
pub bottom: T | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This object will hold all exports. | |
var Haste = {}; | |
/* Thunk | |
Creates a thunk representing the given closure. | |
If the non-updatable flag is undefined, the thunk is updatable. | |
*/ | |
function T(f, nu) { | |
this.f = f; | |
if(nu === undefined) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE RecordWildCards #-} | |
module Promise where | |
import Control.Monad | |
import Data.IORef | |
import Data.Maybe | |
data Status | |
= Pending |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -ex | |
if [ `uname` == 'Linux' ]; then | |
PASTE=xclip\ -o | |
OPEN=xdg-open | |
else | |
# Assume OSX | |
PASTE=pbpaste |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x :: String | |
Just (Just (x:[])) = Just (Just []) | |
main :: IO () | |
main = putStrLn x |
NewerOlder