Skip to content

Instantly share code, notes, and snippets.

body {
font-family: Helvetica, Verdana
}
p {
padding: 7px 10px;
}
#demo {
border: 1px solid #999;
}
@bewest
bewest / field_descriptor.js.coffee
Created April 29, 2012 22:04
field descriptors
App.Views.FieldDescriptor = Backbone.View.extend(
###
FieldDescriptor automatically generates CSS selectors from a
a Model by iterating over keys found in Model.toJSON( ).
It binds to el passed to it using this basic template:
$prefix.$key .value, $prefix.$key.value
For most DOM nodes, we replace the text with the actual value.
For inputs, we replace the values. For inputs and checkboxes,
we set the control's checked property if the value is the same.
@bewest
bewest / 99-novatel.rules
Created June 24, 2012 22:41
How to get Virgin Mobile USA Broadband2Go working in Ubuntu Linux 9.10
# /etc/udev/rules.d/99-novatel.rules
ENV{ID_CDROM}==”?*”, ENV{ID_SERIAL}==”Novatel_Mass_Storage*”, RUN+=”/usr/local/bin/bb2go %k”
@bewest
bewest / Cakefile
Created July 2, 2012 05:12
FieldDescriptor
# ** Cakefile Template ** is a Template for a common Cakefile that you may use in a coffeescript nodejs project.
#
# It comes baked in with 5 tasks:
#
# * build - compiles your src directory to your lib directory
# * watch - watches any changes in your src directory and automatically compiles to the lib directory
# * test - runs mocha test framework, you can edit this task to use your favorite test framework
# * docs - generates annotated documentation using docco
# * clean - clean generated .js files
files = [
@bewest
bewest / README.markdown
Created July 28, 2012 22:13
oe-core, bitbake theory of operation

Basic theory of operation for using openembedded goes something like this:

I usually have project directories to work under each project in eg /git/. Eg project foo has a working and source directory I use to track it under /git/foo/. So I end up producing builds in /git/foo/builds/ and working on source in /git/foo/src.

Openembedded is composed of many granular parts, but basically works like this: the minimal core is oe-core and bitbake; meta-* packages provide granularity and openembedded, yocto et al to tweak the

@bewest
bewest / TintShade.rb
Created August 2, 2012 06:18
tint/shade sass extension
# tint and shade are better than lighten and darken
module Sass::Script::Functions
# Mixes a color with white to the dilution indicated by percentage
def tint(color, dilution = Sass::Script::Number.new(50))
if color.value == "transparent"
color = Sass::Script::Color.new([255, 255, 255, 0])
end
assert_type color, :Color
@bewest
bewest / README.markdown
Created August 12, 2012 07:41
useful git
git log --all-match --grep="interesting/subject/prefix" -10000 \
  --pretty="format:commit %h %an %s %N" trunk \
  | while read op hash name subject ; do
    echo $op $hash r$(git svn find-rev $hash) $name $subject;
  done 

git log   --grep="interesting/subject/prefix" \
  --pretty="format:commit %h %an %s"   | grep -E "^commit" \
  | while read op hash author subject; do

echo $op $hash r$(git svn find-rev $hash) $subject;

class @Santoor
constructor: ->
@name = 1;
@SantoorSong = Backbone.View.extend(
render: ->
$("#main").html("Ritesh")
@bewest
bewest / bewest-nodejs-native.build.log
Created September 4, 2012 18:47
nodejs do_populate_sysroot fails: bitbake
DEBUG: Removed the following variables from the environment: PSEUDO_BINDIR, OE_SOURCE_DIR, OE_BUILD_DIR, DISTRO_DIRNAME, PSEUDO_LOCALSTATEDIR, SSH_CLIENT, PSEUDO_LIBDIR, LD_LIBRARY_PATH, HISTCONTROL, SSH_ASK_PASS, SHLVL, LL_DJANGO_MODE, BBFETCH2, OE_BASE, LD_PRELOAD, EDITOR, OE_BUILD_TMPDIR, STY, PSEUDO_OPTS, TERMCAP, SSH_CONNECTION, BUILDDIR, SSH_TTY, OLDPWD, PSEUDO_PREFIX, SCRIPTS_BASE_VERSION, WINDOW, DJANGO_SETTINGS_MODULE, MAIL, LS_COLORS
DEBUG: Found bblayers.conf (/home/bewest/src/beagle-board-setup-scripts/conf/bblayers.conf)
DEBUG: LOAD /home/bewest/src/beagle-board-setup-scripts/conf/bblayers.conf
DEBUG: Adding layer /home/bewest/src/beagle-board-setup-scripts/sources/meta-angstrom
DEBUG: LOAD /home/bewest/src/beagle-board-setup-scripts/sources/meta-angstrom/conf/layer.conf
DEBUG: Adding layer /home/bewest/src/beagle-board-setup-scripts/sources/meta-openembedded/meta-oe
DEBUG: LOAD /home/bewest/src/beagle-board-setup-scripts/sources/meta-openembedded/meta-oe/conf/layer.conf
DEBUG: Adding layer /home
@bewest
bewest / error.log
Created September 9, 2012 18:54
error compiling node-sqlite-fts for node 0.9.1-release
bewest@ripen:~/Documents/git/node-sqlite-fts$ npm install
> sqlite-fts@0.0.9 preinstall /home/bewest/Documents/git/node-sqlite-fts
> node-waf configure build
Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar