Skip to content

Instantly share code, notes, and snippets.

View zeppelin's full-sized avatar
🐹

Gabor Babicz zeppelin

🐹
View GitHub Profile
@nhunzaker
nhunzaker / compass.rb
Created November 2, 2011 20:35
Compass with Sprites on Rails 3.1
# Note:
# Place this file within the config directory of your Rails 3.1 Application
##########################################################################################
# This configuration file works with both the Compass command line tool and within Rails.
# Require any additional compass plugins here.
project_type = :rails
# Set this to the root of your project when deployed:
http_path = "/"
@coolaj86
coolaj86 / how-to-publish-to-npm.md
Last active June 3, 2026 23:24
How to publish packages to NPM

Getting Started with NPM (as a developer)

As easy as 1, 2, 3!

Updated:

  • Aug, 08, 2022 update config docs for npm 8+
  • Jul 27, 2021 add private scopes
  • Jul 22, 2021 add dist tags
  • Jun 20, 2021 update for --access=public
  • Sep 07, 2020 update docs for npm version
@jamesarosen
jamesarosen / add_child_view.js
Created October 17, 2011 23:13
Template View with Dynamic Children in Sproutcore 2.0
(function() {
// Essentially function(name = "SC.View", options = {data: {}, hash: {}})
var parseHelperArguments = function(viewClassNameOrOptions, options) {
var viewClass;
if (_.isString(viewClassNameOrOptions)) {
viewClass = SC.getPath(viewClassNameOrOptions);
sc_assert( "Could not find view class %@".fmt(viewClassNameOrOptions), viewClass != null );
options = options || {};
} else {
@joubertnel
joubertnel / gist:1289689
Created October 15, 2011 15:13
Dynamic state transition from sibling states in a SproutCore state chart
gotoStateFromFirstSiblingCurrentState: function(destinationState, commonParentState, defaultSourceState) {
var sourceState = this.get('currentStates').find(function(s) {
var isSibling = s.getPath('parentState.stateName') === commonParentState;
return isSibling;
});
sourceState = sourceState || defaultSourceState;
this.gotoState(destinationState, sourceState);
}
@p01
p01 / LICENSE.txt
Last active May 23, 2024 13:46 — forked from 140bytes/LICENSE.txt
Sudoku Solver in 140bytes
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Mathieu 'p01' Henri - http://www.p01.org/releases/
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@kaelig
kaelig / Gemfile
Created September 7, 2011 00:20
Sass & CoffeeScript automated compiling and minifying with Guard
source "http://rubygems.org"
group :development do
gem 'rake'
gem 'guard'
gem 'coffee-script'
gem 'rb-fsevent'
gem 'rb-inotify'
gem 'compass', '0.11.5'
gem 'sass', '3.1.5'
gem 'guard-compass'
@mislav
mislav / Gemfile
Created August 31, 2011 21:48
How to integrate Compass with Rails 3.1 asset pipeline
group :assets do
gem 'sass-rails', '~> 3.1.0'
gem 'coffee-rails', '~> 3.1.0'
gem 'uglifier'
gem 'compass'
end
@tomdale
tomdale / gist:1134558
Created August 9, 2011 16:53
Load remote Handlebars templates
jQuery.get('/templates/foo.handlebars', function(data) {
var template = SC.Handlebars.compile(data);
SC.TEMPLATES['foo'] = template;
})
@hoverlover
hoverlover / active_admin_heroku.rb
Created June 7, 2011 16:35
Rails initializer for using ActiveAdmin with Sass on Heroku
if Rails.env.production?
require 'fileutils'
FileUtils.mkdir_p(Rails.root.join("tmp", "stylesheets", "admin"))
template_path_one = "#{Gem.loaded_specs['activeadmin'].full_gem_path}/app/assets/stylesheets"
template_path_two = "#{Gem.loaded_specs['activeadmin'].full_gem_path}/lib/active_admin/sass"
old_compile_path = "#{Rails.root}/public/stylesheets/admin"
new_compile_path = "#{Rails.root}/tmp/stylesheets/admin"
Sass::Plugin::remove_template_location template_path_one
class InfoDesk
def trains
:trains
end
def flights
:flights
end
def buses
:buses
end