Skip to content

Instantly share code, notes, and snippets.

View FlorianWendelborn's full-sized avatar
🇺🇦

Florian Wendelborn FlorianWendelborn

🇺🇦
View GitHub Profile
@mjumbewu
mjumbewu / Complex.js
Last active December 15, 2015 21:48 — forked from dsamarin/Complex.js
var Complex = function(real, imag) {
if (!(this instanceof Complex)) {
return new Complex (real, imag);
}
if (typeof real === "string" && imag == null) {
return Complex.parse (real);
}
this.real = Number(real) || 0;
@hnry
hnry / catch-all-middleware.js
Created February 1, 2017 01:36
catch all unhandled errors or bad responses
const spirit = require("spirit").node
const catchall = (handler) => (request) => handler(request).then((resp) => {
// something beforehand gave a bad response
// set our own custom message
if (!spirit.is_response(resp)) {
return { status: 500, headers: {}, body: "generic error message because of bad response" }
}
return resp
// something beforehand threw an error
@itsMapleLeaf
itsMapleLeaf / auto-resize-tree-view.less
Created March 24, 2017 22:16
Styles for an automatically resizing tree-view
.tree-view-resizer {
width: max-content;
}
// hide the resize handle so we don't accidentally break things
.tree-view-resize-handle {
display: none;
}
// add some padding for breathing room (optional)
@adamatan
adamatan / arduinoLedBinaryCount.c
Created July 27, 2012 13:28
Arduino: count from 0 to 255 in Led Binary
/* ---------------------------------------------------------
* | Arduino Experimentation Kit Example Code |
* | CIRC-02 .: 8 LED Fun :. (Multiple LEDs) |
* ---------------------------------------------------------
*
* A few Simple LED animations
*
* For more information on this circuit http://tinyurl.com/d2hrud
*
*/
@datagrok
datagrok / ergodox.md
Last active January 14, 2019 07:45
Reflections on my ErgoDox keyboard
@iznax
iznax / Readme.md
Created February 23, 2012 04:24
Mini Tetris in less than 140 bytes

Mini Tetris

A slightly more well-behaved version of Tetris than some other 140 byte projects. The left and right sides of the screen block player movement. The game view is larger and the width and height of the screen are included as constants you can manipulate.

Play 140-character Version

I made a more accurate version of the game with proper all the rotating pieces. This of course is larger and the core logic takes 256 characters.

Play Full Version

@alairock
alairock / styles.less
Last active October 3, 2019 15:49
Atom.io custom styling.
/*
* Your Stylesheet
*
* This stylesheet is loaded when Atom starts up and is reloaded automatically
* when it is changed.
*
* If you are unfamiliar with LESS, you can read more about it here:
* http://www.lesscss.org
*/
@kanaka
kanaka / addTwo.wast
Last active June 17, 2021 21:39
Run wast (WebAssembly) in node
(module
(func $addTwo (param i32 i32) (result i32)
(i32.add
(get_local 0)
(get_local 1)))
(export "addTwo" (func $addTwo)))
@grantslatton
grantslatton / hngen.py
Last active September 27, 2021 11:07
A program that uses Markov chains to generate probabilistic Hacker News titles.
import urllib2
import re
import sys
from collections import defaultdict
from random import random
"""
PLEASE DO NOT RUN THIS QUOTED CODE FOR THE SAKE OF daemonology's SERVER, IT IS
NOT MY SERVER AND I FEEL BAD FOR ABUSING IT. JUST GET THE RESULTS OF THE
CRAWL HERE: http://pastebin.com/raw.php?i=nqpsnTtW AND SAVE THEM TO "archive.txt"
@GavinRay97
GavinRay97 / guide.md
Last active January 4, 2022 05:38
Configuring Nuxt for Composition API and TSX Support

Main

EDIT: DO NOT USE THIS. THIS WAS FROM WHEN ALL OF THIS WAS NEW/EXPERIMENTAL AND NOT OFFICIALLY SUPPORTED. PLEASE SEE THE LINK BELOW FOR THE PROPER, EASIER INTEGRATION NOWADAYS =)

Use create-nuxt-app and enable the Typescript related options to scaffold a new boilerplate TS Nuxt repo:

yarn create nuxt-app