Skip to content

Instantly share code, notes, and snippets.

@aranair
aranair / Sample API calls
Last active December 21, 2015 08:29
sample API for list of hotels in location
---- Hotel List in Location ----
[
{
"id": 29292,
"name":"Hotel Royal",
"stars":4,
"image":"http://cdn.wego.com/gazo/43/274b48b1f505e856e94fbcc0dbdc5c2cf03b5c6c/3464648_B.jpg",
"rank":1,
"brand_id":255,
"latitude":34.67454,
@aranair
aranair / Trustyou Flops v5.8
Last active December 21, 2015 17:08
Trustyou Flops v5.8
{ "meta" : { "code" : 200 },
"response" : { "category_list" : [ { "category_id" : "21",
"category_name" : "Wellness/Sports",
"count" : 147,
"score" : 90,
"sentiment" : "pos",
"sub_category_list" : [ { "category_id" : "21b",
"category_name" : "Fitness Area",
"count" : 94,
"score" : 95,
@aranair
aranair / propertyguru
Last active August 29, 2015 14:02
Kimono stuff
{
"name": "propertyguru",
"count": 1510,
"frequency": "daily",
"version": 15,
"newdata": true,
"results": {
"listings": [
{
"title": {
@aranair
aranair / Conversions
Last active October 24, 2016 07:27
Openssl Stuff
Convert a DER file (.crt .cer .der) to PEM
openssl x509 -inform der -in certificate.cer -out certificate.pem
Convert a PEM file to DER
openssl x509 -outform der -in certificate.pem -out certificate.der
Convert a PKCS#12 file (.pfx .p12) containing a private key and certificates to PEM
openssl pkcs12 -in keyStore.pfx -out keyStore.pem -nodes
You can add -nocerts to only output the private key or add -nokeys to only output the certificates.

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@aranair
aranair / tmux-cheatsheet.markdown
Last active August 29, 2015 14:21 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
require 'minitest/autorun'
require 'rack/test'
require 'active_record'
require 'logger'
# ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: '25595')
# ActiveRecord::Base.establish_connection(adapter: 'postgresql', database: '25595')
# ActiveRecord::Base.establish_connection(adapter: 'mysql2', database: 'test', user: 'root', password: '')
ActiveRecord::Base.logger = Logger.new(STDOUT)
@aranair
aranair / 25712
Created July 13, 2016 09:13
25712
begin
require 'bundler/inline'
rescue LoadError => e
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'
raise e
end
gemfile(true) do
source 'https://rubygems.org'
gem 'rails', '4.2.6'
begin
require 'bundler/inline'
rescue LoadError => e
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'
raise e
end
gemfile(true) do
source 'https://rubygems.org'
gem 'rails', '5.0.0'
gem 'pg'
@aranair
aranair / capybara cheat sheet
Created July 26, 2016 09:15 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')