Skip to content

Instantly share code, notes, and snippets.

View v2keener's full-sized avatar

Gustavo (Keener) DeLaFuerza v2keener

View GitHub Profile
@v2keener
v2keener / index.html
Created December 7, 2017 21:52
Simple Bit // source http://jsbin.com/cexolon
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Simple Bit</title>
</head>
<body>
<script src="https://code.jquery.com/jquery-3.1.0.js"></script>
<div>
@v2keener
v2keener / index.html
Created December 7, 2017 21:49
Simple Bit // source http://jsbin.com/cexolon
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Simple Bit</title>
</head>
<body>
<script src="https://code.jquery.com/jquery-3.1.0.js"></script>
<div id="a"></div>
@v2keener
v2keener / bit.fs
Last active August 29, 2015 14:08
(*
This is a command-line app that allows you to type whatever you want and get [Yes|No|[Maybe]] as an answer.
It also creates log files, one for each day, and one for each month.
This file compiles with:
fsc.exe bit.fs --standalone
/*
I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace
so it's better encapsulated. Now you can have multiple random number generators
and they won't stomp all over eachother's state.
If you want to use this as a substitute for Math.random(), use the random()
method like so:
var m = new MersenneTwister();
@v2keener
v2keener / onOffTest.ino
Created October 6, 2014 20:26
Arduino Off/On switch via semaphore
// This bitty program allows me to have a simple push button operate as if it were a toggle switch
int switchState = 0;
boolean isOn = true; // state of pin 3
boolean isFirstLoop = true; // mutex
void setup(){
// Set pins 2 and 3 to OUTPUT
for(int x = 2; x <=3; ++x){
@v2keener
v2keener / SumDigitsMeta.scala
Created September 20, 2014 01:41
SumDigits, only more meta.
object SumDigits {
def maxInt = 2147483647
def printResult(arg: Int){
printResult(arg, sumDigits(arg));
}
def printResult(arg: Int, result: Int){
printf("Sum of %d is %d\n", arg, result);
}
object SumDigits {
def main(args: Array[String]) {
println("heelo [sic] world");
sumDigits(94); //13
sumDigits(32); //5
sumDigits(44); //8
sumDigits(5232); //12
sumDigits(3535235); //26
sumDigits(2147483647); //46 (Int [31 bit + 1 bit for sign] max value)
}
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key
# that enables you to choose a character from a menu of options. If you are on Lion
# try it by pressing and holding down 'e' in any app that uses the default NSTextField
# for input.
#
# It's a nice feature and continues the blending of Mac OS X and iOS features. However,
# it's a nightmare to deal with in Sublime Text if you're running Vintage (Vim) mode,
# as it means you cannot press and hold h/j/k/l to move through your file. You have
# to repeatedly press the keys to navigate.
@v2keener
v2keener / .vimrc
Created April 10, 2014 16:19 — forked from JeffreyWay/.vimrc
set nocompatible " Disable vi-compatibility
set t_Co=256
colorscheme xoria256
set guifont=menlo\ for\ powerline:h16
set guioptions-=T " Removes top toolbar
set guioptions-=r " Removes right hand scroll bar
set go-=L " Removes left hand scroll bar
set linespace=15
@v2keener
v2keener / tampermonkey-basic-injection-w-jQuery.js.sublime-snippet
Last active April 1, 2016 08:26
Snippet: Base TamperMonkey injection script with jQuery via Google APIs
// ==UserScript==
// @name ${1:Some fancy name}
// @namespace ${2:https://gist.github.com/9665787}
// @version 0.1
// @description ${3:Some description}
// @match /* ALLOW TAMPERMONKEY TO FILL THIS IN *OR* COPY FROM TAMPERMONKEY */
// @copyright 2014+, ${4:Gustavo Keener}
// ==/UserScript==
// Add jQuery, unless it already exists