Skip to content

Instantly share code, notes, and snippets.

View zeppelin's full-sized avatar
🐹

Gabor Babicz zeppelin

🐹
View GitHub Profile
@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
@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);
}
@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 {
@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
@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 = "/"
@kylefinley
kylefinley / main.coffee
Created November 21, 2011 11:47
SproutCore 20 Routing + Statechart
require 'sproutcore'
require 'sproutcore-statechart'
require 'sproutcore-routing'
App = SC.Application.create()
App.GlobalNavController = SC.Object.create(
home: -> App.statechart.gotoState 'home'
about: -> App.statechart.gotoState 'about'
)
@joewest
joewest / gist:1483578
Created December 15, 2011 23:59
ember.js concurrent substates?
var State = Ember.State.extend({});
var ViewState = Ember.ViewState.extend({});
// existing
App.statechart = Ember.StateManager.create({
loggedOut: ViewState.create({}),
loggingIn: ViewState.create({}),
loggedIn: Ember.StateManager.create({
appLoadFailed: ViewState.create({}),
appLoading: ViewState.create({}),
<script type="text/x-handlebars" data-template-name="list-view">
<ul>
{{#each posts}}
{{#view MyApp.PostView contentBinding="this"}}
{{#with content}}
<li class="post">
<a href="#">
<img data-id="{{unbound id}}" src="{{unbound embed_url}}">
<span class="meta">{{unbound short_text}}</span>
</a>
@christophermanning
christophermanning / README.mkd
Last active July 13, 2026 02:13
Hamiltonian Graph Builder
<style type="text/css">p {text-align:center;width: auto}</style>

Created by Christopher Manning

Gallery

Axle Eight Fibbobaci Florets [![Star]

@lamikae
lamikae / jhw-assets.md
Created February 5, 2012 12:28
Jasmine headless testing on Rails 3 asset pipeline

Jasmine headless testing on Rails 3 asset pipeline

  • assets and specs can be CoffeeScript
  • 3rd party JS can be placed to vendor/assets/javascripts or vendor gems
  • detects gem-vendored JS via application.js require
  • uses jasmine-headless-webkit to run the suite outside the browser
    • this requires Qt4.7 installation