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
| { | |
| call: { | |
| stats: [ | |
| { | |
| activity_time: "01/12 - 02/12", | |
| outgoing: 0, | |
| incoming: 0 | |
| }, | |
| { | |
| activity_time: "03/12 - 10/12", |
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
| Activity.all.each do |activity| | |
| begin | |
| puts activity.id | |
| if (tz=activity.get_value_from_info('timezone')) | |
| if Time.find_zone(tz) | |
| activity.activity_time_with_zone = DateTime.strptime(activity.activity_time.in_time_zone( tz ).strftime("%m/%d/%Y %H:%M:%S"), "%m/%d/%Y %H:%M:%S") | |
| activity.save! | |
| end | |
| end | |
| rescue Exception => e |
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
| def tip(msg); puts; puts msg; puts "-"*100; end | |
| # | |
| # 30 Ruby 1.9 Tips, Tricks & Features: | |
| # http://www.igvita.com/2011/02/03/new-ruby-19-features-tips-tricks/ | |
| # | |
| tip "Upgrading to Ruby 1.9 is simple: rvm install 1.9.2 && rvm --default 1.9.2" | |
| tip "Ruby 1.9 supports named captures in regular expressions!" |
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
| def migration_template(source, destination=nil, config={}) | |
| destination = File.expand_path(destination || source, self.destination_root) | |
| migration_dir = File.dirname(destination) | |
| @migration_number = self.class.next_migration_number(migration_dir) | |
| @migration_file_name = File.basename(destination).sub(/\.rb$/, '') | |
| @migration_class_name = @migration_file_name.camelize | |
| destination = self.class.migration_exists?(migration_dir, @migration_file_name) |
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
| <script> | |
| // Charles Lawrence - Feb 16, 2012. Free to use and modify. Please attribute back to @geuis if you find this useful | |
| // Twitter Bootstrap Typeahead doesn't support remote data querying. This is an expected feature in the future. In the meantime, others have submitted patches to the core bootstrap component that allow it. | |
| // The following will allow remote autocompletes *without* modifying any officially released core code. | |
| // If others find ways to improve this, please share. | |
| var autocomplete = $('#searchinput').typeahead() | |
| .on('keyup', function(ev){ | |
| ev.stopPropagation(); |
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
| # install Homebrew (figure it out yourself) | |
| #use brew to install postgresql | |
| brew install postgresql | |
| # Next, try and run the executable for postgresql command | |
| psql |
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
| TypeError: Cannot read property '0' of undefined | |
| at new View (/Users/kaushik/dev/my_repos/retailer-catalog-backend/node_modules/express/lib/view.js:41:65) | |
| at Function.app.render (/Users/kaushik/dev/my_repos/retailer-catalog-backend/node_modules/express/lib/application.js:486:12) | |
| at ServerResponse.res.render (/Users/kaushik/dev/my_repos/retailer-catalog-backend/node_modules/express/lib/response.js:753:7) | |
| at exports.new (/Users/kaushik/dev/my_repos/retailer-catalog-backend/routes/api/user.js:80:7) | |
| at callbacks (/Users/kaushik/dev/my_repos/retailer-catalog-backend/node_modules/express/lib/router/index.js:161:37) | |
| at param (/Users/kaushik/dev/my_repos/retailer-catalog-backend/node_modules/express/lib/router/index.js:135:11) | |
| at pass (/Users/kaushik/dev/my_repos/retailer-catalog-backend/node_modules/express/lib/router/index.js:142:5) | |
| at Router._dispatch (/Users/kaushik/dev/my_repos/retailer-catalog-backend/node_modules/express/lib/router/index.js:170:5) | |
| at Object.router (/Users/ka |
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
| Running "uglify:build" (uglify) task | |
| WARN: Dropping unused function argument message [build/diamond-search.js:13583,32] | |
| WARN: Dropping unused function argument $depth [build/diamond-search.js:13691,39] | |
| WARN: Side effects in initialization of unused variable Router [build/diamond-search.js:14343,4] | |
| WARN: Dropping unused function argument slider [build/diamond-search.js:9694,36] | |
| WARN: Non-strict equality against boolean: == false [build/diamond-search.js:9890,17] | |
| WARN: Dropping unused function argument collection [build/diamond-search.js:10500,25] | |
| WARN: Dropping unreachable code [build/diamond-search.js:10394,10] | |
| WARN: Condition always true [build/diamond-search.js:11566,6] | |
| WARN: Dropping unused function argument options [build/diamond-search.js:12114,21] |
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
| #!/usr/bin/env coffee | |
| http = require 'http' | |
| express = require '/usr/local/lib/node_modules/express' | |
| # ----- | |
| argv = process.argv.slice(2) | |
| argvLen = argv.length |
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
| # These are my notes from the PragProg book on CoffeeScript of things that either | |
| # aren't in the main CS language reference or I didn't pick them up there. I wrote | |
| # them down before I forgot, and put it here for others but mainly as a reference for | |
| # myself. | |
| # assign arguments in constructor to properties of the same name: | |
| class Thingie | |
| constructor: (@name, @url) -> | |
| # is the same as: |