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
[ | |
{ | |
"backcolor": "#333333", | |
"name": "roy Ergodone - Base Layer", | |
"author": "Roy van der Meij <roy@royapps.nl>", | |
"radii": "20px", | |
"switchMount": "cherry", | |
"switchBrand": "cherry", | |
"switchType": "MX1A-G1xx", | |
"pcb": false, |
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
# generate a validator proc | |
def generate_access_token | |
validator = ->(x){ !self.class.exists?(token: token) } | |
self.token = TokenGenerator.generate!(&validator) | |
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
class Reference < ActiveRecord::Base | |
belongs_to :user | |
validates :reference_type, :inclusion => {:in => %w(babysitter tutor etc)} | |
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
module Order::FianetScore | |
extend ActiveSupport::Concern | |
included do | |
include FianetScore | |
after_save :submit_to_fianet_score_if_state_changed | |
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
#Controller: | |
format.json { | |
render :json => {:ticket => @ticket.to_ember}.to_json | |
} | |
#Model: | |
# Ticket | |
def to_ember | |
{ | |
:id => id, |
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 'rubygems' | |
require 'bundler' | |
require 'pathname' | |
require 'logger' | |
require 'fileutils' | |
Bundler.require | |
module Sprockets | |
class StaticCompiler |
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
$('.splitter').draggable({ | |
axis: 'x', | |
containment: '#content', | |
distance: 0, | |
drag: function(event, ui) { | |
var width = $('#content').width(); | |
$('#content .leftpane').css({ width: ui.position.left + 'px' }); | |
$('#content .rightpane').css({ | |
left: ui.position.left + 1 + 'px', | |
width: (width - ui.position.left + 1) + 'px' |
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
<VirtualHost *> | |
ServerAdmin email@example.com | |
ServerAlias myurl.com | |
ProxyRequests Off | |
<Proxy *> | |
Order deny,allow | |
Allow from all | |
</Proxy> |
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
class LiquidHandler | |
PROTECTED_ASSIGNS = %w( template_root response _session template_class action_name request_origin session template | |
_response url _request _cookies variables_added _flash params _headers request cookies | |
ignore_missing_templates flash _params logger before_filter_chain_aborted headers ) | |
def self.call(template) | |
new.compile(template) | |
end | |
def compile(template) |
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
ad = ActiveDirectory.new('user','password','host','dc=domain,dc=com') | |
pp ad.get_mail('someuser') | |
pp ad.get_members("someuser") | |
if ad.member_of? "someuser", "administrators" | |
puts "YES We can do work" | |
end | |
Credits go to Glenn West: http://mentalpagingspace.blogspot.com/2008/12/ruby-on-rails-are-you-member.html |
NewerOlder