Skip to content

Instantly share code, notes, and snippets.

View kevinwestern's full-sized avatar

Kevin Western kevinwestern

View GitHub Profile
#example {
width: 75px;
height: 75px;
background-color: black;
-moz-transition: all 2s ease-in-out 0.5s;
-o-transition: all 2s ease-in-out 0.5s;
-webkit-transition: all 2s ease-in-out 0.5s;
transition: all 2s ease-in-out 0.5s
}
@kevinwestern
kevinwestern / gist:4525925
Created January 13, 2013 20:07
Angular navigation
/** NavController */
'use strict';
testnavApp.controller('NavController', function($scope, $location) {
$scope.isActiveTab = function(tab) {
return $location.path().indexOf(tab) !== -1;
};
});
/** html **/
var http = require('restler'),
jsdom = require('jsdom');
function getPrice(html) {
var start = html.search(/\$\d+/);
if (start === -1) {
return -1;
}
return +html.substring(start + 1, html.substring(start + 1).search(/\D+/) + 1);
};
$scope.playTrack = function(track) {
SC.oEmbed(track.permalink_url, { auto_play: true }, function(oEmbed) {
$scope.$apply(function() {
$scope.embeded = oEmbed;
});
});
};
$scope.$watch($scope.embeded, function(){ console.log('omg'); });
var app = angular.module('apm', ['apm.controller']);
app.config(['$routeProvider', function($routeProvider) {
alert('test');
$routeProvider.when('/', {
controller: 'HomeCtrl',
template: '/static/templates/home.ng'
}).otherwise({redirectTo: '/'});
}]);
@kevinwestern
kevinwestern / _.md
Created October 29, 2013 22:20
schanges
@kevinwestern
kevinwestern / _.md
Created October 31, 2013 15:34
Tributary inlet
function thisIsOk() {
var name = getName();
var age = getAge();
if (age < 21) {
console.log("You're too young!");
} else {
console.log("Come on in!");
}
}
@kevinwestern
kevinwestern / angular-indexeddb.js
Created May 10, 2014 19:30
Angular indexedDB
// Code goes here
var myApp = angular.module('myApp', ['ngResource']);
myApp.factory('indexedDB', ['$window', '$q', function($window, $q) {
var version = 2;
var indexedDB = $window.indexedDB;
var request = indexedDB.open('myapp', version);
var db = null;
var defer = $q.defer();
// Calculator.java
public class Calculator {
public Calculator() {
}
public int add(int num1, int num2) {
return num1 + num2;
}
}