Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Bikram Suwal veekram

🎯
Focusing
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
View Blackhawk Cyber Caphilates present the LARGEST EMAIL LEAK in the HISTORY OF NEPAL.txt
/* *----- Blackhawk Cyber Caphilates -----* */
/* Blackhawk Cyber Caphilates present the LARGEST LEAK in NEPAL's HISTORY! */
/* Talk with us: https://twitter.com/caphilates */
/* 37,122 Nepali Emails */
/* *----- Blackhawk Cyber Caphilates -----* */
/* ** THIRTY-SEVEN THOUSAND ONE HUNDRED AND TWENTY TWO ** */
003anish@gmail.com
@veekram
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
INSTALL
=======
$ gem install activerecord
in GEMFILE: gem ‘activerecord’
REQUIRE
=======
require ‘active_record’
@veekram
veekram / examples.md
Created Oct 4, 2018 — forked from jonschlinkert/examples.md
Three files: examples.md, yaml-cheatsheet.md and yaml-cheatsheet.yml
View examples.md

adapted from this blog

# YAML
name: Jon
# YAML
object:
@veekram
veekram / urls.txt
Created Jul 23, 2018 — forked from jgamblin/urls.txt
Top 1000 Domains
View urls.txt
google.com
youtube.com
facebook.com
baidu.com
yahoo.com
amazon.com
wikipedia.org
google.co.in
twitter.com
qq.com
@veekram
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
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";
file.open("w"); // open file with write access
file.writeln("First line of text");
file.writeln("Second line of text " + str);
file.write(str);
file.close();
@veekram
veekram / postgres-cheatsheet.md
Created Jun 1, 2018 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet
View postgres-cheatsheet.md

PSQL

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
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="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://v1_0.validation.ws.chief.blau.de/">
<soapenv:Header/>
<soapenv:Body>
<v1:validateName>
<validationRequest>
<names>
<firstName>David</firstName>
<lastName>Hasselhoff</lastName>
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:

/people/6

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.

You can’t perform that action at this time.