⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
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
Warden::Manager.serialize_into_session{|user| user.id } | |
Warden::Manager.serialize_from_session{|id| User.get(id) } | |
Warden::Manager.before_failure do |env,opts| | |
# Sinatra is very sensitive to the request method | |
# since authentication could fail on any type of method, we need | |
# to set it for the failure app so it is routed to the correct block | |
env['REQUEST_METHOD'] = "POST" | |
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
var SITE = SITE || {}; | |
SITE.fileInputs = function() { | |
var $this = $(this), | |
$val = $this.val(), | |
valArray = $val.split('\\'), | |
newVal = valArray[valArray.length-1], | |
$button = $this.siblings('.button'), | |
$fakeFile = $this.siblings('.file-holder'); | |
if(newVal !== '') { |
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
IterableCollection = Backbone.Collection.extend({ | |
initialize: function() { | |
//_.bindAll(this, ) | |
this._resetIndexes(); | |
}, | |
_resetIndexes: function() { | |
this.currentIndex = 0; | |
this.hasSelection = false; | |
}, | |
parse: function(response) { |
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
#include <SPI.h> | |
#include <Ethernet.h> | |
// Enter a MAC address and IP address for your controller below. | |
// The IP address will be dependent on your local network: | |
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; | |
byte ip[] = { 192,168,1,3 }; | |
byte server[] = { 192,168,1,2 }; | |
String request = "GET /ping?q=123 HTTP/1.0"; |
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 ApplicationController < ActionController::Base | |
... | |
# FORCE to implement content_for in controller | |
def view_context | |
super.tap do |view| | |
(@_content_for || {}).each do |name,content| | |
view.content_for name, content | |
end | |
end | |
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
requiredUsers = new UserDataVOFilter(allUsers) | |
.onlyManagers() | |
.withCompanyKey(3) | |
.withStatus(UserStatus.STAFF) | |
.data; |
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 Jekyll | |
class Pagination < Generator | |
# This generator is safe from arbitrary code execution. | |
safe true | |
# Generate paginated pages if necessary. | |
# | |
# site - The Site. | |
# |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<scheme name="BlueForestDev" version="1" parent_scheme="Default"> | |
<option name="LINE_SPACING" value="1.1" /> | |
<option name="EDITOR_FONT_SIZE" value="12" /> | |
<option name="EDITOR_FONT_NAME" value="Menlo" /> | |
<colors> | |
<option name="ADDED_LINES_COLOR" value="8080" /> | |
<option name="ANNOTATIONS_COLOR" value="8080ff" /> | |
<option name="ANNOTATIONS_MERGED_COLOR" value="80ff80" /> | |
<option name="CARET_COLOR" value="ffffff" /> |
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
// | |
// Runs a folder of tests or a single test, using QUnit and outputs a JUnit xml file ready for sweet integration with your CI server. | |
// | |
// @usage | |
// DISPLAY=:0 phantomjs qunit-runner.js --qunit qunit.js --tests tests-foler/ --package package.json --junit qunit-results.xml | |
// | |
// package.json is a common JS package file which contains a list of files that need to be loaded before the tests are run. In this instance | |
// the package.json lists the files for a JS SDK, that gets loaded and then the tests test the SDK. | |
// | |
// Designed to run via PhantomJS. |
OlderNewer