Skip to content

Instantly share code, notes, and snippets.

View r3wt's full-sized avatar
😅
Move Fast. Break Things.

Garrett R. Morris r3wt

😅
Move Fast. Break Things.
  • Walmart
  • Hartman, Arkansas, United States
View GitHub Profile
@ahmed-musallam
ahmed-musallam / generate-icns.sh
Created February 24, 2020 15:42
A Shell script to generate .ico and .icns files (mac/windows app icons) from a single PNG
# Required deps:
# imagemagick: https://imagemagick.org/script/download.php
# name of your master icon, must be at least 512X512
PNG_MASTER="icon-large.png"
ICONSET_FOLDER="AppIcon.iconset"
sizes=(
16x16
32x32
@mrcoles
mrcoles / AsyncStripeProvider.js
Last active December 8, 2020 14:28
A react provider abstraction for loading the stripe.js file asynchronously to use with Stripe Elements
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { StripeProvider } from 'react-stripe-elements';
export default class AsyncStripeProvider extends Component {
static propTypes = {
apiKey: PropTypes.string.isRequired
};
// constructor
@marshallswain
marshallswain / states.js
Created March 18, 2018 02:01
US States & Abbreviations as JavaScript Array
var usStates = [
{ name: 'ALABAMA', abbreviation: 'AL'},
{ name: 'ALASKA', abbreviation: 'AK'},
{ name: 'AMERICAN SAMOA', abbreviation: 'AS'},
{ name: 'ARIZONA', abbreviation: 'AZ'},
{ name: 'ARKANSAS', abbreviation: 'AR'},
{ name: 'CALIFORNIA', abbreviation: 'CA'},
{ name: 'COLORADO', abbreviation: 'CO'},
{ name: 'CONNECTICUT', abbreviation: 'CT'},
{ name: 'DELAWARE', abbreviation: 'DE'},
@chunter
chunter / pageant-autoload-keys-at-startup.txt
Created June 20, 2017 10:51
Make Pageant autoload keys at startup
To make Pageant automatically run and load keys at startup:
- Find the location of pageant.exe
- Windows key + R to open the 'run' dialog box
- Type: 'shell:startup' in the dialog box
- Create a shortcut to the pageant.exe and put into this startup folder.
@straker
straker / README.md
Last active March 17, 2024 07:03
Basic Snake HTML and JavaScript Game

Basic Snake HTML and JavaScript Game

Snake is a fun game to make as it doesn't require a lot of code (less than 100 lines with all comments removed). This is a basic implementation of the snake game, but it's missing a few things intentionally and they're left as further exploration for the reader.

Further Exploration

  • Score
  • When the snake eats an apple, the score should increase by one. Use context.fillText() to display the score to the screen
@q42jaap
q42jaap / express-async.js
Created April 6, 2017 14:51
A way to allow async await style middleware
import Layer from 'express/lib/router/layer';
const Promise = global.Promise;
/**
* "fixt" express mbt promises. Als een stukje middleware een promise returnt dan moeten errors eigenlijk aan next worden gegeven.
*
* We hadden ook de suffix `Async` kunnen gebruiken om naast de bestaande functies nieuwe te maken. Dat heeft een flink nadeel
* omdat de api op verschillende manieren te benaderen is.
*/
@thetutlage
thetutlage / scroll.js
Created December 13, 2016 17:21
Scroll to the bottom of an element with smooth animation - Pure Javascript
function scrollTo (element, duration) {
if (!element) {
return
}
var target = element.scrollHeight
target = Math.round(target)
duration = Math.round(duration)
if (duration < 0) {
return false
}
@TechFounder
TechFounder / style.css
Created June 27, 2016 03:05
Buddha bless your code to be bug free
//
// _oo0oo_
// o8888888o
// 88" . "88
// (| -_- |)
// 0\ = /0
// ___/`---'\___
// .' \\| |// '.
// / \\||| : |||// \
// / _||||| -:- |||||- \
@arfon
arfon / big_query_examples.md
Last active September 19, 2022 13:00
BigQuery Examples for blog post

How many times shouldn't it happen...

-- https://news.ycombinator.com/item?id=11396045

SELECT count(*)
FROM (SELECT id, repo_name, path
        FROM [bigquery-public-data:github_repos.sample_files]
 ) AS F
@aligoren
aligoren / lt_install.sh
Last active August 18, 2018 10:26
Light Table Installation Script
#!/bin/bash
#title :lt_install.sh
#description :LightTable Installation Script
#author :<goren.ali@yandex.com> Ali GOREN
#date :2015-10-31
#version :0.1
#usage :chmod u+x, ./lt_install.sh
#notes :progressFilt Source-> http://stackoverflow.com/a/4687912
#bash_version :4.3.11(1)-release