Skip to content

Instantly share code, notes, and snippets.

View bernardop's full-sized avatar

Bernardo Pacheco bernardop

View GitHub Profile

Keybase proof

I hereby claim:

  • I am bernardop on github.
  • I am bernardop (https://keybase.io/bernardop) on keybase.
  • I have a public key whose fingerprint is 1A8A C866 612B 59EF D63F 6553 EF9F 4FEF 61EC B5FA

To claim this, I am signing this object:

#!/usr/bin/env node
var exec = require('child_process').exec,
util = require('util'),
fs = require('fs'),
contents = null,
branch, desc;
// expect .git/COMMIT_EDITMSG
if(/COMMIT_EDITMSG/g.test(process.argv[2])){
// look for current branch name
@bernardop
bernardop / gongos-jquery-ext.js
Created April 25, 2012 20:18
Gongos jQuery plugins
// Have a checkall and checkone in the same page
(function ($) {
jQuery.fn.onePageCheckallCheckone = function (options) {
// Default settings
var settings = $.extend({
'firstQuestion': '',
'secondQuestion': '',
'isLastExclusive': false
}, options);
System.Random RandNum = new System.Random();
checkedNum = RandNum.Next(1, 3).ToString();
List<int> rands = new List<int>();
for (int x = 1; x <= Convert.ToInt16(checkedNum); x++)
rands.Add(RandNum.Next(1, 76));
for (int x = 1; x <= 76; x++)
{
if (rands.Contains(x) && Q205.Choices[x - 1].ShowChoice)
helper += "Q205_" + x + "=1;";