Skip to content

Instantly share code, notes, and snippets.

View TechnotronicOz's full-sized avatar
🦖

Matt Carter TechnotronicOz

🦖
View GitHub Profile
@TechnotronicOz
TechnotronicOz / round.go
Last active August 29, 2015 14:17 — forked from pelegm/round.go
package main
import (
"log"
"math"
)
func Round(val float64, roundOn float64, places int ) (newVal float64) {
var round float64
pow := math.Pow(10, float64(places))
@TechnotronicOz
TechnotronicOz / index.js
Last active August 29, 2015 14:06 — forked from jbrooksuk/index.js
var https = require('https');
var Notification = require('node-notifier');
var CronJob = require('cron').CronJob;
var storesUrl = 'https://reserve.cdn-apple.com/GB/en_GB/reserve/iPhone/stores.json';
var stockUrl = 'https://reserve.cdn-apple.com/GB/en_GB/reserve/iPhone/availability.json';
var stockLastUpdated;
var stores;

What are we trying to observe? Raw object data.

// Objects
var obj = { id: 2 };
obj.id = 3; // obj == { id: 3 }
 
// Arrays
var arr = ['foo', 'bar'];
arr.splice(1, 1, 'baz'); // arr == ['foo', 'baz'];
setup_placeholders = (function() {
$.support.placeholder = false;
test = document.createElement('input');
if('placeholder' in test) {
$.support.placeholder = true;
return function() {}
} else {
return function(){
var PureComponent = React.createClass({
shouldComponentUpdate: function(nextProps, nextState) {
return !equals(this.props.value, nextProps.value);
},
render: function() {
return this.props.children();
}
});
var pure = function(value, childrenThunk) {
/**
* @jsx React.DOM
*/
var CommentModel = Backbone.Model.extend({
defaults: {
author: '',
text: '',
image: ''
}
(function() {
_.extend(Backbone.Router.prototype, Backbone.Events, {
before: function(){},
after : function(){},
route : function(route, name, callback) {
Backbone.history || (Backbone.history = new Backbone.History);
if (!_.isRegExp(route)) route = this._routeToRegExp(route);
Backbone.history.route(route, _.bind(function(fragment) {
var args = this._extractParameters(route, fragment);
if( _(this.before).isFunction() ){
request = require 'request'
facebook = require 'fb'
get_fb_data = (req, res, next) ->
fb_req = 'https://graph.facebook.com/oauth/access_token?client_id=APP_ID&client_secret=APP_SECCRET&grant_type=client_credentials'
request.get fb_req, (err, res, body) ->
if err then console.log err
/* The Grid ---------------------- */
.lt-ie9 .row { width: 940px; max-width: 100%; min-width: 768px; margin: 0 auto; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row.large-collapse .column,
.lt-ie9 .row.large-collapse .columns { padding: 0; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row .row.large-collapse { margin: 0; }
.lt-ie9 .column, .lt-ie9 .columns { float: left; min-height: 1px; padding: 0 15px; position: relative; }
.lt-ie9 .column.large-centered, .columns.large-centered { float: none; margin: 0 auto; }
/* Row and Column defaults */
.row { margin-left: auto; margin-right: auto; margin-top: 0; margin-bottom: 0; max-width: 62.5em; width: 100%; }
.row .row.collapse { margin-left: 0; margin-right: 0; max-width: none; width: auto; }
.row .row { margin-left: -0.9375em; margin-right: -0.9375em; max-width: none; width: auto; }
.row.collapse .column, .row.collapse .columns { padding-left: 0; padding-right: 0; float: left; }
.column, .columns { padding-left: 0.9375em; padding-right: 0.9375em; width: 100%; float: left; position: relative; }
/* Up to 640px */
@media only screen {
.small-1 { width: 8.33333% }