Skip to content

Instantly share code, notes, and snippets.

View schmod's full-sized avatar
🌈
now in color

Andrew Schmadel schmod

🌈
now in color
View GitHub Profile
@Jalle19
Jalle19 / createSelectionSetAppendingTransform.js
Created December 21, 2018 11:29
createSelectionSetAppendingTransform
import { WrapQuery } from 'graphql-tools'
import { SelectionSetNode, Kind } from 'graphql'
/**
* Creates a WrapQuery schema transform that appends the specified field to the selection set of the
* specified parent field name. This can be used to assure queries used by dataloader include the
* field used to align the results (usually some "id" field)
* @param parentFieldName
* @param appendedFieldName
*/
@rauchg
rauchg / README.md
Last active January 6, 2024 07:19
require-from-twitter
@sobolews
sobolews / llnode-lldb-showdown.txt
Last active July 14, 2017 03:07
Debugging an infinite loop in node.js 6.0
Install lldb-3.6 and llnode. On Ubuntu:
git clone https://github.com/indutny/llnode
cd llnode
sudo apt-get install lldb-3.6 lldb-3.6-dev
git clone https://chromium.googlesource.com/external/gyp.git tools/gyp
./gyp_llnode -Dlldb_dir=/usr/lib/llvm-3.6/ -Dlldb_lib=lldb-3.6
make -C out/ -j9
sudo make install-linux
@dideler
dideler / upgrade-postgres-9.3-to-9.4.md
Last active June 8, 2020 03:24
Upgrading PostgreSQL from 9.3 to 9.4 when upgrading Ubuntu 14.04 to 14.10

TL;DR

Create a backup:

pg_dumpall > mybackup.sql

Perform the upgrade:

sudo pg_dropcluster 9.4 main --stop
@BenMorel
BenMorel / .travis.install-mysql-5.7.sh
Last active December 6, 2019 06:24
Install MySQL 5.7 on Travis-CI
sudo apt-get remove --purge "^mysql.*"
sudo apt-get autoremove
sudo apt-get autoclean
sudo rm -rf /var/lib/mysql
sudo rm -rf /var/log/mysql
echo mysql-apt-config mysql-apt-config/enable-repo select mysql-5.7-dmr | sudo debconf-set-selections
wget http://dev.mysql.com/get/mysql-apt-config_0.2.1-1ubuntu12.04_all.deb
sudo dpkg --install mysql-apt-config_0.2.1-1ubuntu12.04_all.deb
sudo apt-get update -q
sudo apt-get install -q -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" mysql-server
@jashkenas
jashkenas / semantic-pedantic.md
Last active July 13, 2024 04:25
Why Semantic Versioning Isn't

Spurred by recent events (https://news.ycombinator.com/item?id=8244700), this is a quick set of jotted-down thoughts about the state of "Semantic" Versioning, and why we should be fighting the good fight against it.

For a long time in the history of software, version numbers indicated the relative progress and change in a given piece of software. A major release (1.x.x) was major, a minor release (x.1.x) was minor, and a patch release was just a small patch. You could evaluate a given piece of software by name + version, and get a feeling for how far away version 2.0.1 was from version 2.8.0.

But Semantic Versioning (henceforth, SemVer), as specified at http://semver.org/, changes this to prioritize a mechanistic understanding of a codebase over a human one. Any "breaking" change to the software must be accompanied with a new major version number. It's alright for robots, but bad for us.

SemVer tries to compress a huge amount of information — the nature of the change, the percentage of users that wil

@lcaballero
lcaballero / tmLaguage Syntax Keys
Created February 26, 2013 04:33
Scraped .tmLanguage files. Looking for the syntax keys, which in this pulls only the name tags with dotted, fully qualified, tuples (so not very sophisticated).
comment.block.antlr
comment.block.applescript
comment.block.bibtex
comment.block.c
comment.block.css
comment.block.d
comment.block.documentation
comment.block.documentation.javadoc
comment.block.documentation.js
comment.block.documentation.json
@mattheworiordan
mattheworiordan / rate_limit.js
Created July 15, 2011 14:49
Rate limiting function calls with JavaScript and Underscore.js
/* Extend the Underscore object with the following methods */
// Rate limit ensures a function is never called more than every [rate]ms
// Unlike underscore's _.throttle function, function calls are queued so that
// requests are never lost and simply deferred until some other time
//
// Parameters
// * func - function to rate limit
// * rate - minimum time to wait between function calls
// * async - if async is true, we won't wait (rate) for the function to complete before queueing the next request