Skip to content

Instantly share code, notes, and snippets.

View bbttxu's full-sized avatar

adam krawiec bbttxu

View GitHub Profile
(function(ko) {
var updateOrInit = function (element, valueAccessor, allBindingsAccessor, data) {
var latLng = new google.maps.LatLng(data.latitude(), data.longitude());
var mapOptions = {
zoom: 16,
center: latLng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(element, mapOptions);
module.exports = (grunt)->
js_src_files = [ 'Scripts/**/*.js' ]
coffee_source =
'Scripts/coffee/'
grunt.initConfig
jshint:
all:
@bbttxu
bbttxu / gist:7086905
Created October 21, 2013 16:42
jquery plugin boilerplate
((factory) ->
if typeof define is "function" and define.amd
# AMD. Register as an anonymous module.
define ["jquery"], factory
else
# Browser globals
factory jQuery
) ($) ->
// This is a manifest file that'll be compiled into including all the files listed below.
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
// be included in the compiled file accessible from http://example.com/assets/application.js
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
//= require jquery
//= require jquery_ujs
//= require jquery-ui
//= require jquery.sparkline
%w{ python-software-properties }.each do |pkg|
package pkg
end
execute 'add node.js apt repo' do
command 'add-apt-repository ppa:chris-lea/node.js'
end
%w{ nodejs npm }.each do |pkg|
package pkg
(function($){
$(document).ready( function() {
$('#woo_feedback-3, #categories-2, #woo_twitter-2', 'body.home').hide();
});
})(jQuery);
source :rubygems
gem 'serve', '1.5.1'
# Use edge instead:
# gem 'serve', :git => 'git://github.com/jlong/serve.git'
# Use Compass and Sass
gem 'compass'
require 'rubygems'
require 'json'
has_waypoints = true
lat = 34
lon = 118
min = 0.01
max = 0.09
@bbttxu
bbttxu / action_helper.rb
Created October 7, 2012 19:44
#PROBLEM: how to render HAML in helper like in a view? likely Ruby or Rails issue
module ApplicationHelper
def li_link_to(text, url, options = nil)
link_to_unless_current text, url, options do |text, url, options|
Haml::Engine.new("%li.active= link_to(#{text}, #{url}, #{options})").render
end
end
end
require 'rubygems'
require 'rack'
require 'rack-legacy'
require 'rack-rewrite'
require 'rack/tidy'
# flipped, returning late rather than first to get around LocalJumpError
# http://blog.jayfields.com/2007/03/ruby-localjumperror-workaround.html#4379157363252949431
INDEXES = ['index.cgi', 'index.php', 'index.html']