# This example does an AJAX lookup and is in CoffeeScript
$('.typeahead').typeahead(
# source can be a function
source: (typeahead, query) ->
# this function receives the typeahead object and the query string
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
| fields = [:switch, :sha_ind, :dtdm, :utdm, :ttdm, :actual] | |
| def create_struct name, fields | |
| Struct.new(name, *fields) | |
| end | |
| def create_singleton_struct name, fields | |
| if Struct::const_defined? name | |
| Struct.const_get name | |
| else |
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
| # pm - Print methods of objects in irb/console sessions. | |
| # Goes in ~./irbrc | |
| # | |
| begin # Utility methods | |
| def pm(obj, *options) # Print methods | |
| methods = obj.methods | |
| methods -= Object.methods unless options.include? :more | |
| filter = options.select {|opt| opt.kind_of? Regexp}.first | |
| methods = methods.select {|name| name =~ filter} if filter |
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
| daemon off; | |
| error_log log/error.log crit; | |
| events { | |
| } | |
| http { | |
| uwsgi_temp_path tmp/; | |
| scgi_temp_path tmp/; | |
| proxy_temp_path tmp/; |
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
| My iTunes Match Track upgrading and process info: | |
| If you have less than 25,000 tracks: | |
| 1. First let iTunes Match do its things and find all possible matches in your library and finish uploading any non-matching tracks. | |
| 2. Once its done, make a new Smart Playlist (I made a folder for all my Smart iTunes Match Related Playlists) | |
| Name this one: iCloud-Upgradeable | |
| Criteria: | |
| MATCH ALL: | |
| Bit Rate is less than 256kbps |
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
| class ZendeskTicketsJob | |
| extend Resque::Plugins::ExponentialBackoff | |
| @queue = :low | |
| FIELDS = ['zendesk_id', 'requester_id', 'assignee_id', 'group', 'subject', 'tags', 'status', 'priority', 'via', 'ticket_type', 'created_at', 'assigned_at', 'solved_at', 'resolution_time', 'satisfaction', 'group_stations', 'assignee_stations', 'reopens', 'replies', 'first_reply_time_in_minutes', 'first_reply_time_in_minutes_within_business_hours', 'first_resolution_time_in_minutes', 'first_resolution_time_in_minutes_within_business_hours', 'full_resolution_time_in_minutes', 'full_resolution_time_in_minutes_within_business_hours', 'agent_wait_time_in_minutes', 'agent_wait_time_in_minutes_within_business_hours', 'requester_wait_time_in_minutes', 'requester_wait_time_in_minutes_within_business_hours', 'reservation_code', 'requires_manual_closing'] | |
| def self.perform(url) | |
| `rm /tmp/zendesk_tickets*` | |
| `wget #{url} -O /tmp/zendesk_tickets.csv.zip` | |
| `unzip -p /tmp/zendesk_tickets.csv.zip > /tmp/zendesk_tickets.csv` | |
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
| # see http://stackoverflow.com/questions/5880962/how-to-destroy-jobs-enqueued-by-resque-workers - old version | |
| # see https://github.com/defunkt/resque/issues/49 | |
| # see http://redis.io/commands - new commands | |
| namespace :resque do | |
| desc "Clear pending tasks" | |
| task :clear => :environment do | |
| queues = Resque.queues | |
| queues.each do |queue_name| | |
| puts "Clearing #{queue_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
| { | |
| "use_simple_full_screen": false, | |
| // calculates indentation automatically when pressing enter | |
| "auto_indent": true, | |
| // sets the colors used within the text area (default) | |
| // see https://github.com/olivierlacan/monokaim to download | |
| // the customized Monokai I use. | |
| "color_scheme": "Packages/Color Scheme - Default/Monokaim.tmTheme", |
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
| # MySQL. Versions 4.1 and 5.0 are recommended. | |
| # | |
| # Install the MySQL driver: | |
| # gem install mysql2 | |
| # | |
| # And be sure to use new-style password hashing: | |
| # http://dev.mysql.com/doc/refman/5.0/en/old-client.html | |
| development: | |
| adapter: mysql2 | |
| encoding: utf8 |
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
| // | |
| // Regular Expression for URL validation | |
| // | |
| // Author: Diego Perini | |
| // Created: 2010/12/05 | |
| // Updated: 2018/09/12 | |
| // License: MIT | |
| // | |
| // Copyright (c) 2010-2018 Diego Perini (http://www.iport.it) | |
| // |