Skip to content

Instantly share code, notes, and snippets.

@stites
stites / FocusExample01.htm
Created April 15, 2013 04:29
testing this example
<!DOCTYPE html>
<html>
<head>
<title>Focus Example</title>
<script type="text/javascript" src="EventUtil.js"></script>
</head>
<body>
<p>The textbox will receive focus as soon as the page loads. You can then start typing.</p>
<form method="post" action="javascript:alert('Form submitted!')" id="myForm">
<div>
@stites
stites / Project Ideas.md
Created April 23, 2014 17:44
Future Open-Source projects

If you come across this list by happen-stance on the internet, feel free to get started on them! Also, ping me so that I can help with the contributions!

  • Run your personal bashrc remotely (add a layer of abstraction over SSH)
angular.module('app', ['ui.router'])
.config([
'$stateProvider',
'$urlRouterProvider',
function($stateProvider, $urlRouterProvider) {
'use strict';
$stateProvider
.state('parent', {
abstract: true,
@stites
stites / gist:ba926b0780547acffbeb
Created October 15, 2014 17:23
bash function to get the current git branch
function cb {
git status | grep "On branch " | cut -c 11-
}
alias gpucb=' git push upstream $(cb)'
alias gpocb=' git push origin $(cb)'
alias gplucb='git pull upstream $(cb)'
alias gplocb='git pull origin $(cb)'
@stites
stites / ES6_Array.prototype.fill_polyfill.js
Last active August 29, 2015 14:09
ES6 Array.prototype.fill polyfill
// ES6 Array.prototype.fill polyfill:
// ==================================
// From Mozilla: http://mzl.la/1umD1jc
if (!Array.prototype.fill) {
Array.prototype.fill = function(value) {
if (this == null) {
throw new TypeError('this is null or not defined');
}
var O = Object(this);
var len = O.length >>> 0;
@stites
stites / loggers.js
Last active August 29, 2015 14:10
javascript loggers
// loggers:
var l = console.log.bind(window.console);
var li = function(i){
return function() {
l.apply(window.console, Array.prototype.slice.call(arguments,i,i+1))
};
};
var ln = function(n){
return function() {
l.apply(window.console, Array.prototype.slice.call(arguments,0,n))
let blacklists = ["https://mail.google.com/*","http://www.codeshare.io/*","https://inbox.google.com/*","https://www.shortcutfoo.com/*","https://binatechnologies.atlassian.net/*","https://onlinedispute.transunion.com/*","http://vim-adventures.com/*","http://student.kaptest.com/*","http://www.keybr.com/*", "http://configurator.input.club/"]
#!/bin/bash
FILE=$1;
if [[ $FILE != *".gz"* ]]
then
echo "Please use a gzipped file"
exit 1
fi