Skip to content

Instantly share code, notes, and snippets.


Bikram Suwal veekram

Block or report user

Report or block veekram

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
veekram / ActiveRecord Cheat Sheet v1
Created May 30, 2019 — forked from jessieay/ActiveRecord Cheat Sheet v1
Active Record cheat sheet with examples of queries I've needed most so far
View ActiveRecord Cheat Sheet v1
ActiveRecord cheat sheet / EXAMPLES
$ gem install activerecord
in GEMFILE: gem ‘activerecord’
require ‘active_record’
veekram /
Created Oct 4, 2018 — forked from jonschlinkert/
Three files:, and yaml-cheatsheet.yml

adapted from this blog

name: Jon
veekram / urls.txt
Created Jul 23, 2018 — forked from jgamblin/urls.txt
Top 1000 Domains
View urls.txt
veekram / gist:9a5c482f2ebfd79704d78547960dbdce
Created Jul 12, 2018 — forked from eikes/gist:5a64b661022c756bd6522ed94770e2a6
List of Ruby on Rails Timezone names and their alias
View gist:9a5c482f2ebfd79704d78547960dbdce
["Africa/Algiers", "West Central Africa"],
["Africa/Cairo", "Cairo"],
["Africa/Casablanca", "Casablanca"],
["Africa/Harare", "Harare"],
["Africa/Johannesburg", "Pretoria"],
["Africa/Monrovia", "Monrovia"],
["Africa/Nairobi", "Nairobi"],
["America/Argentina/Buenos_Aires", "Buenos Aires"],
["America/Bogota", "Bogota"],
["America/Caracas", "Caracas"],
veekram / read-write-file.js
Created Jun 1, 2018
Read Write to file with javascript
View read-write-file.js
/// write to file
var txtFile = "c:/test.txt";
var file = new File(txtFile);
var str = "My string of text";"w"); // open file with write access
file.writeln("First line of text");
file.writeln("Second line of text " + str);
veekram /
Created Jun 1, 2018 — forked from Kartones/
PostgreSQL command line cheatsheet


Magic words:

psql -U postgres

Some interesting flags (to see all, use -h):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
veekram / get_workers.rb
Created May 3, 2018 — forked from kerlin/get_workers.rb
Calling the Workday API in Ruby with Savon
View get_workers.rb
#!/usr/bin/env ruby
# Example Ruby CLI script to retrieve worker data from Workday
# Call on command line with worker id; prints worker name
# add "request" or "response" after worker id and prints the
# outgoing xml or received hash and exits.
# Using Savon version 2 for the SOAP client (2.11.2)
# Savon defaults to making the message tag the same as the operation name
View example soap call using savon
SOAP request:
<soapenv:Envelope xmlns:soapenv="" xmlns:v1="">
View friendly_urls.markdown

Friendly URLs

By default, Rails applications build URLs based on the primary key -- the id column from the database. Imagine we have a Person model and associated controller. We have a person record for Bob Martin that has id number 6. The URL for his show page would be:


But, for aesthetic or SEO purposes, we want Bob's name in the URL. The last segment, the 6 here, is called the "slug". Let's look at a few ways to implement better slugs.

veekram / button_spinner.css.sass
Created Feb 8, 2018 — forked from erotte/button_spinner.css.sass
Ajax loading indicator (Spinner) with Rails/SASS/Bootstrap 2/FontAwesome
View button_spinner.css.sass
@extend [class^="icon-"]
@extend .icon-refresh
@extend .icon-spin
+transition(opacity 1s ease, width 0.7s ease, height 0.3s ease)
position: relative
top: -1px
display: inline-block
overflow: hidden
text-decoration: inherit
You can’t perform that action at this time.