Skip to content

Instantly share code, notes, and snippets.

View inooid's full-sized avatar

Boyd Dames inooid

View GitHub Profile
@inooid
inooid / .bash_profile
Created March 16, 2015 09:34
Google command to search on Google from the command line (Mac OS X)
# Command to open the webbrowser and immediately start searching
# for the right keyword.
#
# Usage:
# $ google test query
# $ => Opens the browser on http://www.google.com/search?q=test+query
#
google()
{
@inooid
inooid / bot.js
Created April 28, 2017 14:36
Twitch bot command cooldown concept
// Warning: Keep in mind that this example has a lot of boilerplate,
// because I want to make sure it's as easy to grasp as possible.
// In a real application you would probably want to wrap the cooldown
// check in a higher order function that easily creates a command and
// checks the cooldowns for you.
// The cooldown manager example
var CooldownManager = {
cooldownTime: 30000, // 30 seconds
store: {
@inooid
inooid / .bash-profile
Last active March 23, 2019 16:05
[Terminal] Docker-machine env shortcut
# 1. Add this to your .bash-profile or .zshrc and restart your terminal
function dm-env () {
if [ -z "$1" ] ; then
echo "\e[0;31mERROR:\e[0m no argument supplied"
return;
fi
eval "$(docker-machine env $1)"
echo -e "\033[33;32mSUCCESS:\e[0m docker-machine environment set to: $1"
}
@inooid
inooid / exercises.js
Created August 17, 2018 12:31
Programming Basics - Session 6 (Exercise answers)
// EXERCISE 3:
// ---------------------------------------------------------------------------------------------- /
// 3.1
// ---------------------------------------------------------------------------------------------- /
const alphabet = 'abcdefghijklmnopqrstuvwxyz';
const createProduct = (title, price) => {
return [title, price];
};
let productList = [];
@inooid
inooid / user_settings.json
Created September 27, 2017 10:52
VSCode User Settings
{
"workbench.colorTheme": "Material Theme",
"editor.tabSize": 2,
"editor.fontSize": 14,
"editor.fontFamily": "Fira Mono",
"editor.rulers": [80, 100, 120],
"files.exclude": {
"*.jpg": true,
"*.jpeg": true,
"*.png": true,
@inooid
inooid / arrayGenerator.js
Created December 22, 2016 16:01
Pretty cool way to generate an array with a bunch of numbers as values.
function arrayGenerator(length) {
return Array.apply(null, { length: length }).map(Number.call, Number)
}
### Keybase proof
I hereby claim:
* I am inooid on github.
* I am inooid (https://keybase.io/inooid) on keybase.
* I have a public key whose fingerprint is 4488 9104 18BF 4F7C FCC5 8C4F DF7C EB8E 7D98 0071
To claim this, I am signing this object:
@inooid
inooid / style.css
Last active December 21, 2016 23:22
Helping out someone's css assignment for uni
#column1 .ruleitem:last-child {
margin-bottom: 0;
}
@inooid
inooid / style.css
Last active December 21, 2016 23:21
Helping out someone's css assignment for uni
#about ul {
display: flex;
justify-content: center;
flex-wrap: wrap;
}
#about li{
max-width: 230px;
margin: 10px;
}
@inooid
inooid / redux.js
Created December 16, 2016 14:53
Simple Redux source code... kinda
function createStore(reducer, initialState) {
let currentState = initialState;
let listeners = [];
function getState() {
return currentState;
}
function dispatch(action) {
// Create the state from the reducer