This file contains hidden or 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 controller | |
| angular.module('Lunch.controllers', []) | |
| .controller('LunchCtrl', ($scope, LunchMates) -> | |
| # angular no longer 'unwraps' promises | |
| LunchMates.getLunchMates().then (data) -> | |
| $scope.lunchers = data | |
| ) | |
This file contains hidden or 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
| { | |
| "color_scheme": "Packages/Color Scheme - Default/Monokai Bright.tmTheme", | |
| "font_size": 21.0, | |
| "hot_exit": false, | |
| "ignored_packages": | |
| [ | |
| "Vintage", | |
| "Jade", | |
| "Haml" | |
| ], |
This file contains hidden or 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
| startup, version: 2221 osx x64 channel: stable | |
| executable: /Applications/Sublime Text 2.app/Contents/MacOS/Sublime Text 2 | |
| working dir: / | |
| packages path: /Users/jd/Library/Application Support/Sublime Text 2/Packages | |
| settings path: /Users/jd/Library/Application Support/Sublime Text 2/Settings | |
| PackageSetup not required | |
| catalogue loaded | |
| found 9 files for base name Default.sublime-keymap | |
| found 1 files for base name Default.sublime-mousemap | |
| found 6 files for base name Main.sublime-menu |
This file contains hidden or 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
| # a good gist is a very few, small pieces of easily digestible code | |
| # please break long, heavily commented files into smaller chunks, with clearly defined questions | |
| # and all the context required to communicate to a user what is happening | |
| def longest_string(list) | |
| longest_so_far = list.first | |
| for item in list | |
| if item > longest_so_far | |
| longest_so_far = item | |
| end |
This file contains hidden or 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
| #TO CREATE A NEW CLASS | |
| module EvolutionarySkills | |
| def breed_rapidly(howrapid) | |
| puts newspecies.*(howrapid) | |
| end | |
| end | |
| class SomeNewAnimal | |
| include EvolutionarySkills |
This file contains hidden or 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
| #HOW A LAMBDA WORKS | |
| var1 = lambda {|x,y| puts x + y} | |
| var1.call(1,0) | |
| #running the above will result in 1 | |
| #HOW YIELD WORKS | |
| def method1 | |
| yield | |
| end | |
| method1{ puts "this is a yield block"} |
This file contains hidden or 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
| <html> | |
| <head> | |
| <script type="text/javascript"> | |
| if (typeof Object.create !== 'function') { | |
| Object.create = function (o) { | |
| var F = function () {}; | |
| F.prototype = o; | |
| return new F(); | |
| }; |
This file contains hidden or 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
| development: | |
| adapter: postgresql | |
| encoding: unicode | |
| database: url_development | |
| pool: 5 | |
| username: jd | |
| password: | |
| host: localhost | |
| port: 5432 | |
This file contains hidden or 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
| Following steps at https://developers.google.com/accounts/docs/OAuth2WebServer | |
| Step 1. submit a get request to the google api endpoint, below is example of my (seemingly) correctly formed get request | |
| https://accounts.google.com/o/oauth2/auth?response_type=code&scope=https://mail.google.com/+https://www.googleapis.com/auth/userinfo.email+https://www.googleapis.com/auth/userinfo.profile&client_id=XXXXXXXXXXXX.apps.googleusercontent.com&redirect_uri=http://localhost:4567/oauth2callback&access_type=online | |
| Step 2. receive a callback that contains an authorization code, below is the url I'm receiving back. | |
| http://localhost:9393/oauth2callback?code=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY |
This file contains hidden or 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
| app.rb calls | |
| use OmniAuth::Builder do | |
| provider :twitter, ENV['TWITTER_CONSUMER_KEY'], ENV['TWITTER_CONSUMER_SECRET'] | |
| end | |
| and cat ~/.bashrc | |
| is |
OlderNewer