Skip to content

Instantly share code, notes, and snippets.

View syzer's full-sized avatar
🐕
Woof! Woof!

syzer syzer

🐕
Woof! Woof!
View GitHub Profile
{
"result": "SUCCESS",
"interfaceVersion": "1.0.3",
"requested": "10/17/2013 15:31:20",
"lastUpdated": "10/16/2013 10:52:39",
"tasks": [
{
"id": 104,
"complete": false,
"priority": "high",
@syzer
syzer / gist:e7a69e8a31205766a7c0
Created November 3, 2014 16:52
FP workshop gist
// task #function composiotion
var articles = [
{
title: 'Why OO Sucks by Joe Armstrong',
url: 'http://www.bluetail.com/~joe/vol1/v1_oo.html',
author: {
name: 'Joe Armstrong',
email: 'empty@email.com'
}
},
@syzer
syzer / gist:a5ebde3031d76744397e
Last active August 29, 2015 14:11
Decorators are awesome
/**
* Created by syzer on 12/19/2014.
* ex shows how to decouple constant error checking from function/class body
* AKA TypeScript AKA WarnScript :)
*/
var _ = require('lodash');
function doStuffNumberPlusOneTimes(number, fun) {
"use strict";
@bbrewer97202
bbrewer97202 / index.js
Created October 20, 2016 17:15
Graphicsmagick gm convert svg string buffer to sized jpg with 300 DPI setting
var gm = require('gm');
var source = '<?xml version="1.0" encoding="utf-8"?><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 2550 3300" enable-background="new 0 0 2550 3300" xml:space="preserve"><g><path fill="#53381A" stroke="#1C1308" d="M807.6,1092.5L527.3,1067c-636.9-25.5-509.5,0-458.6,509.5c51,203.8,0,331.2,254.8,331.2 L807.6,1092.5z"/><path fill="#8A5B28" stroke="#1C1308" d="M909.5,1143.5H629.2c-636.9-25.5-509.5,0-458.6,509.5c51,203.8,25.5,305.7,305.7,229.3 L909.5,1143.5z"/><path fill="#454F2E" stroke="#1C1308" d="M807.6,990.6c127.4-254.8,76.4-305.7,458.6-254.8c509.5,127.4,509.5,152.9,891.6,152.9 c254.8,25.5,509.5,101.9,254.8,407.6l-280.2,509.5H450.9L807.6,990.6z"/><path fill="#76894C" stroke="#1C1308" d="M323.5,1703.9v178.3l1146.4,458.6v-178.3L323.5,1703.9z M807.6,990.6 c127.4-254.8,76.4-305.7,382.1-203.8c509.5,152.9,254.8,152.9,789.7,152.9c254.8,25.5,458.6,101.9,254.8,407.6L1954,1856.8 L527.3,1627.5L807.6,990.6z"/
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@morgangiraud
morgangiraud / nvidia-reinstall.sh
Last active December 11, 2020 15:48
Script to reinstall manually nvidia drivers,cuda 9.0 and cudnn 7.1 on Ubuntu 16.04
# Remove anything linked to nvidia
sudo apt-get remove --purge nvidia*
sudo apt-get autoremove
# Search for your driver
apt search nvidia
# Select one driver (the last one is a decent choice)
sudo apt install nvidia-370
@max-mapper
max-mapper / difflint
Last active May 30, 2021 03:26
Run eslint + prettier on only files that you've staged/commited on the current branch
#!/usr/bin/env bash
# chmod +x this and save in your PATH. Assumes `eslint` + `prettier` are in your `devDependencies`
BRANCH=$(git branch | grep \* | cut -d ' ' -f2)
BASE=$(git merge-base master $BRANCH) # change master to whatever your trunk branch is
COMMITED=$(git diff --name-only $BASE $BRANCH)
STAGED=$(git diff --staged --name-only)
FILES=$(printf "$COMMITED\n$STAGED" | sort | uniq)
LINT="npx eslint --ignore-path=.prettierignore $FILES"
PRETTIER="npx prettier --list-different $FILES"
@rrag
rrag / .block
Last active July 31, 2021 16:26
Chart with a dark theme
license: MIT
height: 770
'use strict';
const puppeteer = require('puppeteer');
(async () => {
/* PRECONDITION:
0. download ublock, I used https://github.com/gorhill/uBlock/releases/download/1.14.19b5/uBlock0.chromium.zip
1. run $PATH_TO_CHROME --user-data-dir=/some/empty/directory --load-extension=/location/of/ublock
2. enable block lists you want to use
*/
@qwtel
qwtel / getFiles.js
Last active September 9, 2023 13:43
[node.js 8+] Recursively get all files in a directory
// Node 8+
// --------------------------------------------------------------
// No external dependencies
const { promisify } = require('util');
const { resolve } = require('path');
const fs = require('fs');
const readdir = promisify(fs.readdir);
const stat = promisify(fs.stat);