Skip to content

Instantly share code, notes, and snippets.

View jamesbrink's full-sized avatar
💭
:trollface:

James Brink jamesbrink

💭
:trollface:
View GitHub Profile
From b0a9156259c1ff9f1a0d42a86e08250e37248a0b Mon Sep 17 00:00:00 2001
From: James Brink <[email protected]>
Date: Thu, 27 Dec 2018 04:50:56 -0700
Subject: [PATCH] Updated output_files function to prevent segfault.
I have updated the output_files function in patch.c to gracefully
handle the following scenario.
Given a git style patch like the following.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Usage:
instagram_auto_accept [options]
Options:
-h, --help Show this help screen.
-s, --sleep=<interval> How long to sleep between polling default 60 seconds
-t, --throttle=<interval> How long to sleep betwen accepts

testing vim-gist

@jamesbrink
jamesbrink / go_daddy_vpn.md
Created April 30, 2016 02:11
GoDaddy VPN

Simple script to quickly connect to GoDaddy VPN on OSX

requires stoken Very basic and naive, not sure how to capture the vpn dialog window so we use a sleep 👍

Hint, PIN aka $1 could be included into function risking some security.. not much though.

¯\_(ツ)_/¯

@jamesbrink
jamesbrink / gist:f0f6df9f40e0f3fc4999
Created May 24, 2015 22:49
Useful docker commands
# Misc useful docker commands for use on dev env
# Clean up all stopped containers
docker ps -a|cut -d " " -f 1|grep -v CONTAINER|xargs docker rm
# Clean up all images
docker images |awk '{print $3'}|grep -v IMAGE|xargs docker rmi
@jamesbrink
jamesbrink / gist:a1f08818f81883c2e0cb
Last active April 22, 2018 16:58
Bumblebee & VMware Workstation setup
# Enable VMware guests to have 3d acceleration with bumblbee setups on linux. Use this if you are received the popup messages about no 3d support in guests and you are using bumblebee with optimus or primusrun
echo "mks.gl.allowBlacklistedDrivers = TRUE" >> ~/.vmware/preferences
optirun vmware
t = document.querySelectorAll('.transactionRowPrice'); total = 0; for (i=0; i < t.length; i++){ var price = t[i].innerHTML.replace(/\$|[a-zA-Z]+/gi, ''); if (price != '') {total += parseInt(price)}; }
#!/usr/bin/env ruby
# Simple script to pull down all the repositories of a github user
require 'net/http'
require 'json'
@github_api_base_uri = 'https://api.github.com/users'
def get_repos(username,page)
uri = URI.parse("#{@github_api_base_uri}/#{username}/repos")
uri.query = URI.encode_www_form({:page => page})
@jamesbrink
jamesbrink / gist:8271949
Last active January 2, 2016 07:48
clear out all docker crap
docker ps -a|grep -v "CONTAINER ID"|awk '{print $1}'|xargs docker rm && docker images|grep -v REPOSITORY|awk '{print $3'}|xargs docker rmi
CloudMD::Application.routes.draw do
resources :users
resources :patients do
resources :addresses
resources :phones
end
match 'user_sessions/authenticated', :controller=>'user_sessions', :action=>'authenticated', :via => 'get'