Skip to content

Instantly share code, notes, and snippets.

Switch
Unselected
focus -> Focused Unselected
select -> Selected
Focused Unselected
blur -> Unselected
select -> Focused Selected
Selected
focus -> Focused Selected
unselect -> Unselected
@craveytrain
craveytrain / .hyper.js
Last active July 30, 2019 06:20
hyper-sync-settings
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
@craveytrain
craveytrain / isFirstLetterUpperCase.js
Created July 8, 2016 01:16
Is first character in string upper case
const assert = require( 'assert' );
/**
* Checks if first letter in string is upper case or lower case
*
* @param {string} str - string to test
* @returns {boolean} Returns bool of whether or not the string starts with upper case
*
* @example
* // returns true
@craveytrain
craveytrain / flatten.js
Created July 8, 2016 00:45
flatten array in js
/**
* Flattens nested arrays
*
* @param {array} arr - The nested array
* @returns {array} Returns flattened array
*
* @example
* // returns [ 1, 2, 3, 4 ]
* flattenArray( [ [ 1, 2, [ 3 ] ], 4 ] );
*
@craveytrain
craveytrain / gulpfile.js
Last active August 29, 2015 13:56
My gulpfile setup
var gulp = require('gulp');
var util = require('gulp-util');
var clean = require('gulp-clean');
var browserify = require('gulp-browserify');
var rework = require('gulp-rework');
var prefix = require('gulp-autoprefixer');
var jshint = require('gulp-jshint');
var connect = require('gulp-connect');
var concat = require('gulp-concat');
@craveytrain
craveytrain / index.html
Last active January 4, 2016 17:29
Tech Interests
<!DOCTYPE html>
<meta charset="utf-8">
<title>Tech Interests</title>
<style>
text {
font: 11px sans-serif;
}
</style>
@craveytrain
craveytrain / osx_setup.md
Last active December 26, 2015 04:09
Workstation Install List

This is my install list. There are many others like it but this one is mine. I should probably move this to boxen at some point in time in the future.

#Setup

  1. OSX Update - Make sure the tools are up to date
  2. Sync iCloud
  3. Install homebrew
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
var callback = context.HttpContext.Request.QueryString.AllKeys.FirstOrDefault(k => k == "callback");
var data = "{ "key": "value" }"; // JSON payload
if(string.IsNullOrEmpty(callback))
{
response.ContentType = "application/json";
response.AddHeader("Access-Control-Allow-Origin", "*";
response.Write(data);
}
else
@craveytrain
craveytrain / geo.js
Created January 30, 2012 21:11 — forked from pierceray/geo.js
dataType method
$(document).ready(function () {
$.ajaxSetup({
type: "POST",
contentType: "application/json; charset=utf-8",
data:"{}"
});
var geoRequest = {
"geoRequest": {
"counties": ["Travis"],
@craveytrain
craveytrain / geo.js
Created January 30, 2012 21:04 — forked from pierceray/geo.js
dataFilter method
$(document).ready(function () {
$.ajaxSetup({
type: "POST",
contentType: "application/json; charset=utf-8",
data:"{}",
dataFilter: function(data) {
var msg = jQuery.parseJSON(data);
return (msg.hasOwnProperty('d')) ? msg.d : msg;
});