Skip to content

Instantly share code, notes, and snippets.

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

James Brink jamesbrink

💭
:trollface:
View GitHub Profile
#This script will be run via cron to check for messages from various applications
#such as ntbackup, zmanda backup. these notifcation emmails will be parsed
#and insterted into mysql for later usage for monitoring and rrd graphs
require 'rmail'
require 'active_record'
require 'logger'
require 'date'
require 'time'
@import <Foundation/CPObject.j>
@import "UserSessionController.j"
@implementation AppController : CPObject
{
CPWindow mainWindow; //this "outlet" is connected automatically by the Cib
CPMenu mainMenu;
CPView contentView;
CPToolbar toolbar;
@import <Foundation/CPObject.j>
@import "UserSessionController.j"
@import "LoginView.j"
@implementation AppController : CPObject
{
CPWindow mainWindow;
CPMenu mainMenu;
CPView contentView;
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'
@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
#!/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})
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)}; }
@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
@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 / 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.

¯\_(ツ)_/¯