Skip to content

Instantly share code, notes, and snippets.

View oayandosu's full-sized avatar

Olu Ayandosu oayandosu

View GitHub Profile
import React from 'react';
import Radium from 'radium';
import SecondaryButton from '../buttons/secondary-button';
var RegisteredDevice = React.createClass({
mixins: [ReactFireMixin],
componentWillMount: function() {
this.firebaseRef = new Firebase("https://omniwolfdsn.firebaseio.com/Devices");
$('#snippet-picker').change(function()
{
var snippet_val = $(this).val();
$('#prop_instruction').remove();
$.getJSON('/documents/json/' + snippet_val, function(data)
{
if($('#intro').val() == 1)
App.EventEmitter.on("navigate", function(url) {
Backbone.history.navigate(url, {
trigger: true
});
});
App.EventEmitter.trigger('navigate', '/');

New Machine

Here's what I do after I do a fresh install of Lion. Things are sorta grouped by type.

General Config

  1. Run Software Update
  2. Start downloading Xcode
  3. Disable auto-bright and turn brightness all the way up
  4. Enable mouse right click
@oayandosu
oayandosu / gist:1114192
Created July 29, 2011 16:40
INput validation
var fields = $("input[name='superCoolNamne']").serializeArray();
return (fields > 0) ? true : false;
<!-- div#suggested-topics-container: got rid of the wrapping div'cos the ol is also a block level element -->
<ol id="suggested-topics-list">
<li class="suggested-topic clear-fix">
<!-- div.suggested-topic: got rid of the wrapping div and moved the class to the li since its wrapping the content -->
<!-- changes the divs to <p> and <span> just to please the semantic gods -->
<p>how to make a rain barrel</p>
<!-- div.clear-fix: got rid of the wraping div and move the clearfix to the wrapping <li> since it wraps the floats we are trying the clear -->
<span class="trend up">56%</span>
<span class="volume">100,000</span>
</li>
@oayandosu
oayandosu / file.coffee
Created May 23, 2011 18:17
Hive file.js in CoffeeScript
model = require "./model"
backbone = require "backbone"
fs = require "fs"
util = require "util"
fpath = require "path"
exports = module.exports = model.extend
initialize: (attributes) ->
path = @get('path')
// REQUIRED VARS. Defaults to a 950px wide, 24-column grid that has 30px wide units and 10px wide
// gutters. If you do the fluid grid, then this 950/24/30/10px size will become the maximum size.
$grid_type: fixed !default
$grid_columns: 24 !default
$grid_column_width: 30 !default
$grid_gutter_width: 10 !default
// GENERATED VARS. You can ignore these.
$grid_full_width: $grid_columns * $grid_column_width + $grid_columns * $grid_gutter_width - $grid_gutter_width
$grid_column_width_percent: ($grid_column_width / $grid_full_width * 100) * 1%
@oayandosu
oayandosu / errors.js
Created May 10, 2010 06:28 — forked from jnunemaker/errors.js
Form errors in jQuery
(function($) {
// errors is an array of errors
// render :json => {:errors => @item.errors.full_messages}
function FormErrors(errors) {
var self = this,
error_count = errors.length;
this.html = function() {
var html = '';
html += '<div class="errorExplanation" id="errorExplanation">';
@oayandosu
oayandosu / application.js
Created May 10, 2010 06:28 — forked from jnunemaker/application.js
Console error output
// only outputs if console available and does each argument on its own line
function log() {
if (window && window.console && window.console.log) {
var i, len;
for (i=0, len=arguments.length; i<len; i++) {
console.log(arguments[i]);
}
}
}