Skip to content

Instantly share code, notes, and snippets.

View idlecool's full-sized avatar

Shiv Deepak idlecool

  • Aeroh, Inc.
  • Mountain View, CA
View GitHub Profile
Mozilla/5.0 (compatible; woriobot support [at] worio [dot] com +http://worio.com)
EventMachine HttpClient
MxAgent
Mozilla
Comodo-Certificates-Spider
JS-Kit URL Resolver, http://js-kit.com/
curl/7.15.5 (x86_64-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
Googlebot/2.1 (http://www.googlebot.com/bot.html)
libwww-perl/5.834
Jakarta Commons-HttpClient/3.1
1. Create a HackerRank account from our campaign page
url: https://www.hackerrank.com/campaign/pandodaily
2. After account creation you can login with following url
login url: https://www.hackerrank.com/login
3. (Optional) Once you login, there will be a modal dialog box which will
ask you to fill your school, company and country; as well as you can find

ruby-sam-app

This is a sample template for ruby-sam-app - Below is a brief explanation of what we have generated for you:

.
├── README.md                   <-- This instructions file
├── event.json                  <-- API Gateway Proxy Integration event payload
├── hello_world                 <-- Source code for a lambda function
│   ├── app.rb                  <-- Lambda function code
brew uninstall imagemagick
brew install imagemagick@6
PKG_CONFIG_PATH=/usr/local/Cellar/imagemagick@6/6.9.10-43/lib/pkgconfig gem install rmagick -v '2.16.0'
https://space-admin.okta.com/static/agents/ProvisioningAgent/OktaProvisioningAgent-01.02.03.x86_64.exe
@idlecool
idlecool / wikipedia.to.hdfs.sh
Created March 2, 2018 07:26
Copy wikipedia dataset to HDFS
# install p7zip from here - https://gist.github.com/marcesher/7168642#gistcomment-2249579 (careful about the typo)
# extract the dataset on HDFS
7z x -so enwiki-20080103-pages-meta-history.xml.7z | hadoop fs -put - /user/hadoop/enwiki-20080103-pages-meta-history.xml
bundle exec rake db:drop RAILS_ENV=test
bundle exec rake db:create RAILS_ENV=test
bundle exec rake db:schema:load RAILS_ENV=test
@idlecool
idlecool / user.rb
Last active September 14, 2016 06:03
class User
# class method
# User::find
# some people use User.find, I am not one of those
def self.find id
# ...
end
# instance method
# User#where
@idlecool
idlecool / 0_reuse_code.js
Created April 22, 2016 23:51
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@idlecool
idlecool / craigslist.sh
Created January 16, 2016 04:07
cron job to alert when a car is posted on craigslist
#!/bin/bash
countfile="/root/old.count.txt"
touch $countfile
old_count=$(cat $countfile)
new_count=$(curl -s https://sfbay.craigslist.org/search/cto\?search_distance_type\=mi\&min_price\=2000\&max_price\=8000\&auto_make_model\=honda\&max_auto_miles\=100000\&auto_title_status\=1\&query\=%22mountain+view%22+%7C+%22palo+alto%22+%7C+%22sunnyvale%22+%7C+%22menlo+park%22+%7C+%22redwood+city%22+%7C+%22santa+clara%22 | grep paginator| tail -n 1 | ruby -e 'puts /totalcount">([0-9]*)/.match($stdin.read())[1]')
if [ $old_count -ne $new_count ]; then
curl -X POST https://maker.ifttt.com/trigger/cars/with/key/XXXXXXXXXXXXXXXX
echo $new_count > $countfile