Skip to content

Instantly share code, notes, and snippets.

View DirkyJerky's full-sized avatar

Geoff Yoerger DirkyJerky

  • Wisconsin
View GitHub Profile
@DirkyJerky
DirkyJerky / Property lister
Created May 10, 2014 18:54
List the properties of a javascript object
var depth = 1;
var br = '<br />';
var target = document;
$.each(Object.keys(target), function(K1, V1) {
document.write('"' + V1 + '" : "' + target[V1] + '" [' + (typeof target[V1]) + ']' + br);
/*
if(((typeof target[V1]) == 'object') && target != target[V1]) {
var target2 = target[V1];
$.each(Object.keys(target2), function(K2, V2) {
console.log(K1 + '.' + K2 + ': "' + V2 + '" -> "' + target2[V2] + '"');
@DirkyJerky
DirkyJerky / props.js
Created May 10, 2014 21:02
Create heirarchy of javascript properties in JSON (call via listPropertiesOf(aJSObject, depthLimit))
var excluded = [document];
var listPropertiesOf = function(object, maxDepth) {
return listPropertiesOfWDepth(object, 0, maxDepth);
};
var listPropertiesOfWDepth = function(object, curDepth, maxDepth) {
if(object == null) {
return 'null';
}
/*
console.log("listProperties called w/" + object + ', ' + curDepth + ', ' + maxDepth)
@DirkyJerky
DirkyJerky / 0001-Fix-compilation-errors.patch
Last active August 29, 2015 14:04
Temporary fix for OSX compilation of Grive/grive
From 7e766f1c57b46aa492eee5e2113d04cc98a444ce Mon Sep 17 00:00:00 2001
From: Geoff Yoerger <geoffreyiy1@gmail.com>
Date: Sun, 27 Jul 2014 00:10:35 -0500
Subject: [PATCH] Fix compilation errors
---
libgrive/src/drive/State.cc | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libgrive/src/drive/State.cc b/libgrive/src/drive/State.cc
@DirkyJerky
DirkyJerky / PS1.txt
Last active August 29, 2015 14:06
My bootyful bash prompt variables
export PS1="\\[$(tput setab 4)$(tput setaf 1)\\]"'{\w}'"\\[$(tput sgr0)"'$(~/etc/ps1_exitstatus $?)'"$(tput bold)\\]"'\$'"\\[$(tput sgr0)\\] "
export PS2="\\[$(tput setab 4)$(tput setaf 1)\\]"'>'"\\[$(tput sgr0)\\]"
@DirkyJerky
DirkyJerky / Forms.js
Created February 5, 2015 17:21
Them login forms
var setField = function(fieldName, setValue) {
document.getElementsByName(fieldName).item(0).value = setValue;
};
setField('web_auth_user[username]', 'xxx');
setField('web_auth_user[password]', 'xxx');
var inputs = document.getElementsByTagName('input');
var submitButton = inputs.item(inputs.length - 1);
submitButton.click()
@DirkyJerky
DirkyJerky / ps1_exitstatus
Last active August 29, 2015 14:15
Showing last command exit status in my PS1
if [[ "$1" == "0" ]];
then echo -n $(tput setaf 2);
else echo -n $(tput setaf 1);
fi
var fileref = document.createElement('script');
fileref.setAttribute("type","text/javascript");
fileref.setAttribute("src", "//cdn.jsdelivr.net/vivus/0.1.2/vivus.min.js");
document.getElementsByTagName("head")[0].appendChild(fileref);
function animSVG(svgid) {
new Vivus(svgid, {type: 'oneByOne', start: 'autostart', duration: 200});
}
@DirkyJerky
DirkyJerky / ScrapTF-Raffles.js
Last active February 13, 2024 13:53
Enter all the raffles on http://scrap.tf/raffles
ScrapTF.Raffles.Pagination.LoadNext();
ScrapTF.Raffles.Pagination.LoadNext();
ScrapTF.Raffles.Pagination.LoadNext();
var i = 0;
var list;
setTimeout(function() {
list = document.getElementById("raffles-list").children;
list = [].filter.call(list, function(j) {
if (j.getAttribute("style") == "") {
@DirkyJerky
DirkyJerky / Makefile
Created April 7, 2015 20:28
Simple, dynamic, (windows), Makefile
CC := g++
SRCDIR := src
BINDIR := bin
SRCEXT := cpp
SOURCES := $(shell find $(SRCDIR) -type f -name *.$(SRCEXT))
OBJECTS := $(patsubst $(SRCDIR)/%,$(BUILDDIR)/%,$(SOURCES:.$(SRCEXT)=.exe))
CFLAGS := -g # -Wall
$(BINDIR)/%.exe: $(SRCDIR)/%.$(SRCEXT)
[core]
pager = less -x4
excludesfile = $HOME/.gitignore_global
editor = /usr/bin/vim
[help]
autocorrect = 1
[color]
branch = auto
diff = auto
status = auto