Skip to content

Instantly share code, notes, and snippets.

View despairblue's full-sized avatar
🍸
I always let my imagination run away from me! Then it comes back..... with cake!

Danny Martini despairblue

🍸
I always let my imagination run away from me! Then it comes back..... with cake!
View GitHub Profile
type alias Model =
{ counter : Int
}
type alias InitModel =
{ counter : Maybe Int
}
'use strict'
const express = require('express')
const axios = require('axios')
const format = require('util').format
const app = express()
app.use(function (request, response, next) {
console.log('Got request')
const moment = require('moment')
const dateStringWOTimeZone = '2016-05-29'
const newDate = new Date(dateStringWOTimeZone).toISOString()
const momentDate = moment(dateStringWOTimeZone).toISOString()
const momentUTCDate = moment.utc(dateStringWOTimeZone).toISOString()
const momentFromDate = moment(new Date(dateStringWOTimeZone)).toISOString()
console.log(`
${newDate} = new Date('${dateStringWOTimeZone}').toISOString()
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli '/Users/danny/bin/node_modules/.bin/npm',
1 verbose cli '--registry=http://127.0.0.1:50321',
1 verbose cli 'i' ]
2 info using npm@3.7.2
3 info using node@v5.11.0
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readLocalPackageData
PID: 4785 (atom)
UID: 1000 (despairblue)
GID: 100 (users)
Signal: 11 (SEGV)
Timestamp: Sat 2016-03-19 22:46:00 CET (2min 48s ago)
Command Line: /usr/share/atom-beta/atom --type=renderer --js-flags=--harmony --no-sandbox --lang=en-US --node-integration=true --num-raster-threads=2 --content-image-texture-target=3553,3553,3553,3553,3553,3553,3553,3553,3553,3553,3553,3553,3553 --video-image-texture-target=3553 --disable-accelerated-video-decode --disable-webrtc-hw-encoding --disable-gpu-compositing --channel=4735.0.1978933190 --v8-natives-passed-by-fd --v8-snapshot-passed-by-f
Executable: /usr/share/atom-beta/atom
Control Group: /user.slice/user-1000.slice/session-c2.scope
Unit: session-c2.scope
Slice: user-1000.slice
module TopologySort (..) where
import Html exposing (..)
type alias Topology =
List ( String, List String )
initialTopology : Topology
@despairblue
despairblue / squash-before-public-release.sh
Created March 16, 2016 19:13
squash entire git history
# use at your own risk, might eat hamster and nose dragons
git branch -m master master-bak
git checkout --orphan master
git reset --hard
git commit --allow-empty -m 'init'
git merge --ff --squash master-bak
git commit --amend
git push --force
'use strict'
require('./test1')
require('./test2')
import {getUser} from 'DB'
const getUserPromise = Promise.promisify(getUser)
const goify = fun =>
() =>
fun()
.then(val => [undefined, val])
.catch(error => [error])
'use strict';
const map = new Map([[1,2], ['a', 'b']]);
for (const item of map.keys()) {
console.log(item);
}