Skip to content

Instantly share code, notes, and snippets.

View julia-allyce's full-sized avatar
🦄
unicornunicornunicornunicornunicorn

Julia Allyce julia-allyce

🦄
unicornunicornunicornunicornunicorn
View GitHub Profile
@julia-allyce
julia-allyce / objects.js
Last active August 27, 2015 14:42
Javascript Objects
// object Object
// keys are strings and values can be any type
var a = { 'x': 23, 'y': null, 'z': 'a stringggg', '0': function() {...} };
// properties can be accessed and added with dot notation or braces:
console.log(a.y); // null
console.log(a['0']); // function...
a.q = 20;
a['horses'] = 30;
console.log(a); // { 'x': 23, 'y': null, ... 'q': 20, 'horses': 30 }
@julia-allyce
julia-allyce / primitives.js
Last active October 30, 2015 02:25
Javascript Primitives.
// undefined
var aVariable;
var anObject = { aProperty: 'yay' };
console.log(aVariable); // undefined
console.log(anObject.monkey); // undefined
console.log(someVarNeverDeclared); // undefined
// null
var empty = null;
console.log(empty); // null
var a;
var b;
a = 4;
b = "5";
a += 2; // a == 6
console.log(a + b);
// returns "65"
@julia-allyce
julia-allyce / gist:a5d60604b87930ef9058
Last active August 29, 2015 14:25
"Strong" Typing
package main
var a int //declaring a as an integer
var b string //declaring b as a string
func main () {
a = 4
b = "5"
a += 2 // a == 6
@julia-allyce
julia-allyce / breakpoint-mixins
Created August 4, 2014 19:43
LESS Breakpoint Mixins Using Rulesets
/*
ABOUT BREAKPOINT MIXINS
These are mad awesome. Feel free to add more if you find things acting wierd at a certain
screen size or zoom point. I am using em's based on 16px. Ideally if you aren't using a breakpoint
that means whatever you are working with should look good on a mobile device.
Please refer to the LESS docs on how to use Mixins with Rulesets:
http://lesscss.org/features/#detached-rulesets-feature
*/
@julia-allyce
julia-allyce / keyframe-mixin
Last active August 29, 2015 14:04
LESS Keyframes Mixin
//mixin
.keyframes(@name, @frames) {
@-webkit-keyframes @name { @frames(); }
@-moz-keyframes @name { @frames(); }
@-ms-keyframes @name { @frames(); }
@-o-keyframes @name { @frames(); }
@keyframes @name { @frames(); }
}
//compiles as valid less