Skip to content

Instantly share code, notes, and snippets.

View KingScooty's full-sized avatar
🚀

Scotty Vernon KingScooty

🚀
View GitHub Profile
// place this file in __mocks__
let pendingAssertions
exports.prompt = prompts => {
if (!pendingAssertions) {
throw new Error(`inquirer was mocked and used without pending assertions: ${prompts}`)
}
const answers = {}
@naesheim
naesheim / buildWhenAffected.sh
Last active November 28, 2022 20:20
CircleCi - only build features that has changed
##################
### config.yml ###
##################
version: 2
jobs:
build:
docker:
- image: circleci/python:3.6
steps:
@bmhatfield
bmhatfield / .profile
Last active March 18, 2024 07:43
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else
@fson
fson / rapid-prototyping-with-relay.md
Created October 18, 2015 20:08
Rapid prototyping with Relay (Reactive 2015 lightning talk proposal)

This is a proposal for a lightning talk at the Reactive 2015 conference.

NOTE: If you like this, star ⭐ the Gist - the amount of stars decides whether it makes the cut!

Rapid prototyping with Relay

Relay makes data fetching in React apps simpler, by letting you declare the data needs of your components instead of writing complex imperative code. React, Relay, GraphQL and the other complementary tools are changing how apps are built.

@parente
parente / postinstall.sh
Last active April 23, 2024 06:11
Post-install script to disable SSH password authentication, install latest Docker with AUFS on Ubuntu 14.04 VMs
#!/bin/bash
# Disable password authentication
sudo grep -q "ChallengeResponseAuthentication" /etc/ssh/sshd_config && sed -i "/^[^#]*ChallengeResponseAuthentication[[:space:]]yes.*/c\ChallengeResponseAuthentication no" /etc/ssh/sshd_config || echo "ChallengeResponseAuthentication no" >> /etc/ssh/sshd_config
sudo grep -q "^[^#]*PasswordAuthentication" /etc/ssh/sshd_config && sed -i "/^[^#]*PasswordAuthentication[[:space:]]yes/c\PasswordAuthentication no" /etc/ssh/sshd_config || echo "PasswordAuthentication no" >> /etc/ssh/sshd_config
sudo service ssh restart
# Install latest Docker
sudo apt-get update
sudo apt-get -y install linux-image-extra-$(uname -r)
sudo sh -c "wget -qO- https://get.docker.io/gpg | apt-key add -"
@katemonkeys
katemonkeys / gist:e17580777b57915f5068
Last active February 20, 2024 15:36
Everything Wrong With The Withings API

Top Six Things You Need To Know About The Withings API*

*where “you” is probably a developer, or at least a strange user

I should preface this by saying that I got a Withings Smart Body Analyzer for Christmas last year and I’ve been generally happy with it. It purports to be able to take my heart rate through my bare feet and that seems not to work for my physiology, but overall I’m a fan. If if their Wikipedia page is to be believed they are having a pretty rad impact on making the Quantified Self movement more for normal people and they only have 20 full time employees. Also they try hard to use SI units, which I can get behind. Anyway, on to the rant.

I originally called this post “Everything wrong with the Withings API” and I meant it. For every useful field I can extract from their “award winning” app, I have spent an hour screaming at the inconsistencies in their implementation or inexplicable holes in their data

@bobbygrace
bobbygrace / trello-css-guide.md
Last active April 22, 2024 10:15
Trello CSS Guide

Hello, visitors! If you want an updated version of this styleguide in repo form with tons of real-life examples… check out Trellisheets! https://github.com/trello/trellisheets


Trello CSS Guide

“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”

You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?

@christopheranderton
christopheranderton / homebrew-github-api-token.md
Last active January 2, 2024 13:07
Set your Github API Token If you hit a ”GitHub API rate limit exceeded” when searching with Homebrew (http://brew.sh/).

Description

PLEASE SCROLL DOWN AND READ THE COMMENTS FOR A MORE UP TO DATE WAY (AND EASIER) TO DO THIS
When using Homebrew (http://brew.sh) and searching formulas or pull requests you may get the dreaded error message: Github API Rate limit exceeded

Let's fix that! (yeah!)


Short version

PLEASE SCROLL DOWN AND READ THE COMMENTS FOR A MORE UP TO DATE WAY (AND EASIER) TO DO THIS

@bih
bih / apple-university-stores.json
Last active November 19, 2023 22:36
List of Apple's UK university education stores w/ web addresses
[{"region":"East Midlands","university":"De Montfort University","url":"http://store.apple.com/uk_edu_5000657"},{"region":"East Midlands","university":"Derby University","url":"http://store.apple.com/uk_edu_5000659"},{"region":"East Midlands","university":"Jisc Collections and Janet Limited","url":"http://store.apple.com/uk_edu_5004321"},{"region":"East Midlands","university":"Leicester University","url":"http://store.apple.com/uk_edu_5000710"},{"region":"East Midlands","university":"Lincoln University","url":"http://store.apple.com/uk_edu_5000712"},{"region":"East Midlands","university":"Loughborough College","url":"http://store.apple.com/uk_edu_5000723"},{"region":"East Midlands","university":"Loughborough University","url":"http://store.apple.com/uk_edu_5002639"},{"region":"East Midlands","university":"Nottingham Trent University","url":"http://store.apple.com/uk_edu_5000747"},{"region":"East Midlands","university":"Nottingham University","url":"http://store.apple.com/uk_edu_5000748"},{"region":"East Midla
@crstn
crstn / gist:6552662
Last active December 23, 2015 00:19
Transforms JSON files exported from the moves API [1] into GeoJSON, which can then be used in a number of applications, such as CartoDB or Leaflet. [1] http://dev.moves-app.com
<?php
// this is the directory where you have your json files from the moves API stored
$dir = "/my/input/dir";
// this is where your geojson files will be stored
$outdir = "/my/output/dir";
$geojsonplaces = [
"type" => "FeatureCollection",
"features" => [ ],
];