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
| .config(function (RestangularProvider) { | |
| RestangularProvider.addResponseInterceptor(function (data, operation, what, url, response, deferred) { | |
| return humps.camelizeKeys(data); | |
| }); | |
| RestangularProvider.addRequestInterceptor(function (data, operation, what, url, response, deferred) { | |
| return humps.decamelizeKeys(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
| { "helloWorld": true } |
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/helpers/application_helper.rb | |
| # Render a partial into a script tag so Angular | |
| # sticks it into $templateCache | |
| def load_ng_template(partial) | |
| content_tag :script, type: 'text/ng-template', id: "#{partial}.html" do | |
| render partial | |
| end | |
| 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
| r = /bobcat|sky track|framing|forklift|demolition|plumbing|drywall|concrete|RF & magnetic shielding|electrian|bossman|boss man|fencing|farm equipment|equipment|steel|a job|my job|ur job|working|building|adding onto|18 wheeler|nuclear|powerplant|equipment|work station|my work|motor|fitting|fittin|stainless steal|stainless steel|mechanic|pipe|pipe welding|7018|6010|boiler|tool box|toolbox|tool|grinder|underpaid|repair|Mike Rowe|Miller Electric Welding|manufacturing|metals|forestry & logging|commercial & industrial equipment|industrials|mining materials|tools equipment|trade school|clutch|cylinder|roof|day at the office|carpenter|driver|maintenanceweld|weldor|tig|mig|gmaw|line out|welder|welding|weldin|welding hood|weldin hood/i | |
| string = "my work station in nashville. over $20,000 of equipment sitting on that table" | |
| # =~ | |
| position_time = Benchmark.realtime do | |
| 1000.times do | |
| string =~ r | |
| end | |
| 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
| class MyCustomSerializerClass < ActiveModel::Serializer | |
| class << self | |
| # customize the associated object to the serializer | |
| def model_class | |
| SomeOtherClass | |
| end | |
| end | |
| 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
| cities = [] #1081 california cities | |
| t = Benchmark.realtime do | |
| cities.each { |c| Geocoder.coordinates(" #{c}, ca") } | |
| end | |
| t | |
| ## esri 349.3133 | |
| ## bing 204.9491 |
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
| ['ACTON','ADELANTO','AGOURA HILLS','ALAMEDA','ALAMO','ALBANY','ALHAMBRA','ALISO VIEJO','ALMANOR','ALONDRA PARK','ALPAUGH','ALPINE','ALPINE VILLAGE','ALTADENA','ALTA SIERRA','ALTURAS','ALUM ROCK','AMADOR CITY','AMERICAN CANYON','AMESTI','ANAHEIM','ANDERSON','ANGELS CITY','ANGWIN','ANTIOCH','APPLE VALLEY','APTOS','APTOS HILLS-LARKIN VALLEY','ARBUCKLE','ARCADIA','ARCATA','ARDEN-ARCADE','ARMONA','ARNOLD','AROMAS','ARROYO GRANDE','ARTESIA','ARVIN','ASHLAND','ATASCADERO','ATHERTON','ATWATER','AUBERRY','AUBURN','AUGUST','AVALON','AVENAL','AVERY','AVOCADO HEIGHTS','AZUSA','BAKERSFIELD','BALDWIN PARK','BANNING','BARSTOW','BAY POINT','BAYVIEW','BAYVIEW-MONTALVIN','BAYWOOD-LOS OSOS','BEALE AFB','BEAR VALLEY','BEAR VALLEY SPRINGS','BEAUMONT','BECKWOURTH','BELDEN','BELL','BELLFLOWER','BELL GARDENS','BELMONT','BELVEDERE','BENICIA','BEN LOMOND','BERKELEY','BERMUDA DUNES','BERTSCH-OCEANVIEW','BETHEL ISLAND','BEVERLY HILLS','BIG BEAR CITY','BIG BEAR LAKE','BIG BEND','BIGGS','BIG PINE','BIG RIVER','BIOLA','BISHOP','BLACKHAWK-C |
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
| SELECT "pid","application_name", "backend_start", "xact_start", "query_start", "state_change", "state" FROM pg_stat_activity; |
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
| jobs = Sidekiq.redis { |r| r.zrange("schedule", 0, -1, {withscores: true}) } | |
| Sidekiq.redis { |r| jobs.each {|j| r.zrem "schedule", j } } | |
| Sidekiq.redis { |r| r.FLUSHDB } |
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
| ###gemfile | |
| gem 'paperclip' ## 3.5.1, also 3.4.2 previously | |
| gem 'delayed_paperclip' | |
| gem 'sidekiq', '2.6.4' | |
| ### image.rb | |
| attr_accessible :photo_processing | |
| has_attached_file :photo, | |
| styles: { |