Skip to content

Instantly share code, notes, and snippets.

View mikey-'s full-sized avatar
💭
nm wbu

Mikey Battiston mikey-

💭
nm wbu
View GitHub Profile
@OpenNingia
OpenNingia / terminal_color_scheme
Last active July 27, 2017 09:01
Simple script to apply Solarized color scheme to Pantheon Terminal
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Solarized theme for pantheon-terminal
see http://ethanschoonover.com/solarized
"""
import posixpath
import sys
from gi.repository import Gio
@jokeyrhyme
jokeyrhyme / wait-for.js
Last active June 29, 2019 08:38
JavaScript polling
/**
* @param {Function} condition a function that returns `true` or `false`
* @param {Number} [interval=197] the amount of time to wait between tests
* @param {Function} callback a function to invoke when the condition returns `true`
*/
function waitFor(condition, interval, callback) {
'use strict';
if (condition && condition()) {
callback();
} else {
@RobTrew
RobTrew / soundDeviceToggle.js
Last active May 11, 2024 07:04
Toggling OS X Sound Output Devices with JXA Javascript for Automation (OS X 10.10)
// Rob Trew @complexpoint 2015
function run() {
"use strict";
var blnUseKeyboardMaestro = false;
// EDIT TO NAMES OF TWO ALTERNATIVE SOUND OUTPUT DEVICES
var dctSources = { // A unique substring for each is enough
primary: "Internal",
secondary: "Elgato"
@frnhr
frnhr / .bash_profile
Created March 17, 2016 22:39
Show current pyenv python version in bash prompt, and also color virtual envs differently
####
#### pyenv-virtualenv bash prompt customization
####
# pyenv
eval "$(pyenv init -)"
# pyenv-virtualenv:
@leonardofed
leonardofed / README.md
Last active November 14, 2024 13:37
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


@jokeyrhyme
jokeyrhyme / docker-npm.js
Created August 30, 2016 00:51
execute `npm` within a Docker container, within the host's working directory
'use strict'
// ideal for use with AWS Lambda and native Node.js modules
// requires Docker: https://docs.docker.com/engine/installation/
/*
Usage:
node docker-npm.js install
node docker-npm.js rebuild
@jokeyrhyme
jokeyrhyme / macos-keychain-research.m
Last active June 29, 2019 08:38
incomplete research for a way to delete private keys from the macOS Keychain
//
// main.m
// macos-keychain-delete-private-key
//
// Created by Ron Waldon on 2016-08-30.
// Copyright © 2016 Ron Waldon. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <Security/Security.h>
@jokeyrhyme
jokeyrhyme / load-script-once.js
Last active June 29, 2019 08:38
experimentation with a script loader that de-duplicates requests for scripts
/**
load this prior to to all other scripts on the page,
then it will be able to monitor script loading properly
requires: Promise, MutationObserver, querySelectorAll, Map, Set, const, let
*/
;(() => {
'use strict'
@jokeyrhyme
jokeyrhyme / forty-five-serverless-handlers.js
Last active June 29, 2019 08:38
stress-test script to add 45 AWS APIG routes and 500 AWS Lambda functions via Serverless: https://serverless.com/
'use strict'
const fs = require('fs')
const path = require('path')
const padStart = require('lodash.padstart')
const yaml = require('js-yaml')
const PROJECT_PATH = path.join(__dirname, '..')
const SERVERLESS_PATH = path.join(PROJECT_PATH, 'serverless.yml')
@vyder
vyder / rbenv-in-xcode-build-script.md
Created October 17, 2016 09:24
Using rbenv in an XCode 'Run Script Phase'

If anybody stumbles across this from Google, I found that the simplest thing to do was:

Have devs install rbenv on their machines, and add ~/.rbenv/shims to the PATH in the XCode build script like:

export PATH=~/.rbenv/shims:$PATH
# Exec rest of your script
# ...