curl https://gist.github.com/raw/970438/caff9a09ed2d223b1123a69ede17cb19ad352af9/build.sh | sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('project', ['projectServices']) | |
.config ($routeProvider) -> | |
$routeProvider | |
.when('/login', | |
templateUrl: 'partials/login.html', | |
controller: LoginCtrl) | |
.when('/assignments', | |
templateUrl: 'partials/assignments.html', | |
controller: AssignmentListCtrl) | |
.otherwise(redirectTo: '/login') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'guard/listener' | |
listener = Guard::Listener.select_and_init({ | |
watchdir: '/tmp', | |
watch_all_modifications: true | |
}) | |
listener.on_change do |files| | |
puts "File change: #{ files.join(',') }" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Save your promotion codes in code.csv | |
require 'capybara' | |
require 'csv' | |
session = Capybara::Session.new(:selenium) | |
session.visit 'https://YOURSHOP.myshopify.com/admin/auth/login' | |
session.fill_in 'login', :with => 'YOURLOGIN' | |
session.fill_in 'password', :with => 'YOURPASSWORD' | |
session.click_button 'Sign In' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_.extend(Backbone.Model.prototype, Backbone.Events, { | |
errors: [], | |
validate: function (attrs) { | |
//reset | |
this.errors = []; | |
var model = this; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The form adds model based validation to the form | |
# and it updates the 'reset' and 'save' buttons from the owning | |
# form panel according to the dirty and validity status of the form. | |
# | |
# @author Michael Kessler | |
# | |
Ext.define 'Ext.ux.form.Basic', | |
extend: 'Ext.form.Basic' | |
config: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Everything is an Expression | |
-> | |
greeting = 'Hi CoffeeScripter' | |
# Expect it's undefined | |
-> | |
greeting = 'Hi CoffeeScripter' | |
return undefined |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ActiveRecord | |
# Allows embedding of ActiveRecord models. | |
# | |
# Embedding other ActiveRecord models is a composition of the two | |
# and leads to the following behaviour: | |
# | |
# - Nested attributes are accepted on the parent without the _attributes suffix | |
# - Mass assignment security allows the embedded attributes | |
# - Embedded models are destroyed with the parent when not appearing in an update again |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'siren' | |
# The JsonHelper adds a possibility to query JSON data with a simple query language. | |
# Read more about the Siren JSONQuery implementation at: https://github.com/jcoglan/siren | |
# | |
# @author Michael Kessler | |
# | |
module JsonHelper | |
def json(query) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module RSpec::Rails | |
module WidgetExampleGroup | |
extend ActiveSupport::Concern | |
extend RSpec::Rails::ModuleInclusion | |
include RSpec::Rails::RailsExampleGroup | |
include ActionView::TestCase::Behavior | |
include RSpec::Rails::ViewAssigns | |
include RSpec::Rails::Matchers::RenderTemplate | |
include RSpec::Rails::BrowserSimulators |
NewerOlder