This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// What results can you get just using these characters: +[] | |
// I know this has been done before, but I don't have the link, | |
// and I don't want it (not yet, at least) | |
// basic numbers | |
0: +[] | |
1: ++[+[]][+[]] | |
2: ++[++[+[]][+[]]][+[]] | |
3: ++[++[++[+[]][+[]]][+[]]][+[]] | |
4: ++[++[++[++[+[]][+[]]][+[]]][+[]]][+[]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
osascript -e 'tell application "spotify" to next track' | |
#!/bin/bash | |
osascript -e 'tell application "spotify" to playpause' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8"> | |
<title>LocalStoreBug</title> | |
</head> | |
<body> | |
<script type="text/javascript" charset="utf-8"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Incorrect | |
jQuery(document).ready(function () { | |
var script = document.createElement("script"); | |
script.type = "text/javascript"; | |
script.src = "http://ardrone.swoop.com/js/spxw.js"; // use this for linked script | |
//The following will not properly set the required data attributes properly | |
script.attributes['data-domain'] = 'SW-XXXXXX-X'; | |
script.attributes['data-theme'] = 'red'; | |
script.attributes['data-serverbase']= 'http://ardrone.swoop.com/'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
loadCss: function( cssString, $head) { | |
var $css = $('<style type="text/css">'+cssString+'<style>'); | |
$head = $head || $('head'); | |
$head.append($css); | |
return $css; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var when = require('when'); | |
var meld = require('meld'); | |
var winston = require('winston'); | |
var config = require('./config'); | |
var dbAspects = { | |
introDeferred: function(obj,name) { | |
meld.around(obj, name, function(joinpoint) { | |
var def = when.defer(); | |
var promise = def.promise; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This is the build config for my main JS file. | |
*/ | |
({ | |
baseUrl: "src/", | |
//wrap will wrap the entire script in an IIFE which will create private define/require functions | |
wrap: true, | |
out: 'dist/spxmain.js', | |
modules: [{ | |
name: 'requireLib', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Gets a jquery object containing all of the elements on the page that have a css class of "show-example1" | |
var showDescriptionInput = $('.show-example1'); | |
//when someone clicks on an element with the id of "name" or "phone" run this function. I think "click.toggle" | |
//is a mistake it should be just click | |
$("#name, #phone").bind('click.toggle', function(e) { | |
//dont do the default HTML thing. SO if this is a link dont make the browser load the new page. | |
e.preventDefault(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(function () { | |
'use strict'; | |
var LocationManager = require('modules/spxcontroller/LocationManager'); | |
var WindowManager = require('modules/spxcontroller/WindowManager'); | |
var SlinkAnchorService = require('modules/spxcontroller/SlinkAnchorService'); | |
var PresentationService = require('modules/spxcontroller/PresentationService'); | |
var g = require('utils/globalObject'); | |
var utils = require('utils/utils'); |
OlderNewer