Skip to content

Instantly share code, notes, and snippets.

View NullVoxPopuli's full-sized avatar

NullVoxPopuli

View GitHub Profile
@NullVoxPopuli
NullVoxPopuli / gist:3931189
Created October 22, 2012 11:53
YARD tab only... directive tags not working
##
#@api public
#@!attribute allow_accept
# @return [Boolean] allow the proposal to be accepted
#@!attribute allow_decline
# @return [Boolean] allow the proposal to be declined
#@!attribute allow_downloads
# @return [Boolean] allow the pdf of this proposal to be downloaded
#@!attribute archived
# @return [Boolean] the state of archival
=begin
@api public
@!attribute allow_accept
@return [Boolean] allow the proposal to be accepted
@!attribute allow_decline
@return [Boolean] allow the proposal to be declined
@!attribute allow_downloads
@return [Boolean] allow the pdf of this proposal to be downloaded
@!attribute archived
@return [Boolean] the state of archival
@NullVoxPopuli
NullVoxPopuli / gist:3943045
Created October 24, 2012 00:51
Proposal Object
=begin
@api public
@api public
@!attribute account_id [r]
@return [Integer] the id of the {Account} this {Proposal} is tied to. Can't be changed.
@api public
@!attribute allow_accept
@return [Boolean] allow the proposal to be accepted
@api public
@NullVoxPopuli
NullVoxPopuli / gist:4087759
Created November 16, 2012 14:31
How TinderBox authenticates users via oAuth for using RightSignature
# start with being logged out of right signature or
# logged in as the user that we are going to allow TinderBox with
def set_up_right_signature_oauth
@subscription = Subscription.find(params[:id])
@account = @subscription.account
# get the master/consumer/app credentials
cred = IntegrationsConfig["right_signature"]
# find / generate the client's / account's consumer key/secret pair
@NullVoxPopuli
NullVoxPopuli / gist:5515485
Last active December 16, 2015 23:39
Javascript for prefilling a formstack form for inputs, textareas, radio buttons, checkboxes, dropdowns... just missing date and time, cause those are multiple selects for one "field"
var submission_data = JSON.parse("<%=j(@submission_data[:data].to_json) %>")
var i, field_data, field;
for(i = 0; i < submission_data.length; i++){
field_data = submission_data[i];
// this takes care of inputs, cehckboxes, radios, and textareas
field = $j("[name*=field" + field_data.field + "]" );
if (field.length == 1 && field.length != 0){
if (field[0].nodeName == "INPUT"){
@NullVoxPopuli
NullVoxPopuli / gist:5584905
Created May 15, 2013 15:37
bundle install after adding gem "engineyard" to my gemfile.
Installing termios (0.9.4)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/userhomedir/.rvm/rubies/ruby-1.9.3-p392/bin/ruby extconf.rb
checking for termios.h... yes
checking for unistd.h... yes
creating Makefile
make
compiling termios.c
@NullVoxPopuli
NullVoxPopuli / gist:5724159
Created June 6, 2013 19:22
Information needed to help people debug graphics problems on your linux machine
#!/bin/bash
echo -e "\e[01;33mGraphics Card(s): \e[00m";
lspci | grep VGA;
echo -e "\e[01;33mConnected Monitors: \e[00m";
egrep -i " connected|card detect|primary dev" /var/log/Xorg.0.log;
echo -e "\e[01;33mCurrent Video Driver: \e[00m";
lsmod | grep "kms\|drm";
@NullVoxPopuli
NullVoxPopuli / gist:5957480
Created July 9, 2013 13:48
run rspec with spork
#!/bin/bash
# start spork server if it hasn't been started already
# this may need to be manually killed if plugins, or gems change
if ps ax | grep -v grep | grep -v grep | grep spork > /dev/null
then
echo "spork is already running..."
# simple formatting with color
# drb option specifies to use spork server
bundle exec rspec --format Fuubar --color spec --drb
@NullVoxPopuli
NullVoxPopuli / CEX.IO-spam
Last active December 30, 2015 04:48
CEX.io chat spamming
/*
Modified from:
http://stackoverflow.com/questions/1280263/changing-the-interval-of-setinterval-while-its-running
*/
function setRandomTimeout( callback ){
var internalCallback = function(){
return function() {
var time = randomIntervalDelay();
window.setTimeout( internalCallback, time );
callback();
@NullVoxPopuli
NullVoxPopuli / document_model.js
Created January 23, 2014 15:04
An attempt to make working with jQuery a little more object oriented
/*
Builds a set of actions that are specific to each document type
= require_self
= require_tree ./models
*/
window.TB = window.TB || {};
TB.Object = jQuery.subclass();
$.extend(TB.Object, {
/* static */