Skip to content

Instantly share code, notes, and snippets.

View saqib-nadeem's full-sized avatar

Saqib Nadeem saqib-nadeem

View GitHub Profile
@saqib-nadeem
saqib-nadeem / beautiful_idiomatic_python.md
Created May 31, 2016 01:09 — forked from JeffPaine/beautiful_idiomatic_python.md
Transforming Code into Beautiful, Idiomatic Python: notes from Raymond Hettinger's talk at pycon US 2013. The code examples and direct quotes are all from Raymond's talk. I've reproduced them here for my own edification and the hopes that others will find them as handy as I have!

Transforming Code into Beautiful, Idiomatic Python

Notes from Raymond Hettinger's talk at pycon US 2013 video, slides.

The code examples and direct quotes are all from Raymond's talk. I've reproduced them here for my own edification and the hopes that others will find them as handy as I have!

Looping over a range of numbers

for i in [0, 1, 2, 3, 4, 5]:
@saqib-nadeem
saqib-nadeem / make_github_issue.py
Created May 31, 2016 01:08 — forked from JeffPaine/make_github_issue.py
Make an issue on github using API V3 and Python
import json
import requests
# Authentication for user filing issue (must have read/write access to
# repository to add issue to)
USERNAME = 'CHANGEME'
PASSWORD = 'CHANGEME'
# The repository to add this issue to
REPO_OWNER = 'CHANGEME'
@saqib-nadeem
saqib-nadeem / us_state_abbreviations.py
Created May 31, 2016 01:07 — forked from JeffPaine/us_state_abbreviations.py
A python list of all US state abbreviations.
states = ["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DC", "DE", "FL", "GA",
"HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD",
"MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ",
"NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC",
"SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY"]
@saqib-nadeem
saqib-nadeem / vim-notes.md
Created May 31, 2016 01:06 — forked from JeffPaine/vim-notes.md
General vim notes.

Vim Notes

  • set list Shows invisible characters.
  • set listchars What invisibile characters should be set to, see :h listchars for complete list.

Key Remapping

  • map creates a key map that works in normal, visual, select and operator pending modes
  • map! creates a key map that works in insert and command-line mode.
@saqib-nadeem
saqib-nadeem / gist:b0bee525620129cecd95
Created January 12, 2016 03:41
ITC and EZ Response of vehicle VIN as 1HGCP2F85A1111111
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<ValidateVINResponse xmlns="http://www.itcratingservices.com/webservices/VINHelper/">
<ValidateVINResult>
<YearModel>2010</YearModel>
<Maker>HONDA</Maker>
<Model>ACCORD EX-L</Model>
<VIN>1HGCP2F80A</VIN>
<ISOLiabSymbols>2006=295495;2008=290495;2010=275500;2012=275490;</ISOLiabSymbols>
<RAPALiabSymbol>JKFHHMKMJT</RAPALiabSymbol>
@saqib-nadeem
saqib-nadeem / gist:cfd528ec5db468fed137
Created December 14, 2015 16:30
Sample Code Snippet for Blog Structure Data Markup
<!-- JSON-LD markup generated by Google Structured Data Markup Helper. -->
<script type="application/ld+json">
{
"@context" : "http://schema.org",
"@type" : "BlogPosting",
"headline" : "Collision Insurance",
"datePublished" : "2015-12-03",
"image": {
"@type": "ImageObject",
"url": "http://blog.ensurify.com/wp-content/uploads/2015/09/business-woman-829497_1920-1024x5751.jpg",
@saqib-nadeem
saqib-nadeem / gist:4eceafba391ea6a8b698
Created June 10, 2015 14:55
Error logs while executing command cap production deploy
Saqib-MacBook:inyourcorner_web redbricksystems1$ cap production deploy
DEBUG[6d5d26c3] Running /usr/bin/env [ -d ~/.rbenv/versions/2.0.0-p481 ] on inyourcorneronline.com
DEBUG[6d5d26c3] Command: [ -d ~/.rbenv/versions/2.0.0-p481 ]
DEBUG[6d5d26c3] Finished in 17.863 seconds with exit status 0 (successful).
INFO[cb61157b] Running /usr/bin/env mkdir -p /tmp/inyourcorner_web/ on inyourcorneronline.com
DEBUG[cb61157b] Command: ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.0.0-p481 /usr/bin/env mkdir -p /tmp/inyourcorner_web/ )
INFO[cb61157b] Finished in 1.012 seconds with exit status 0 (successful).
DEBUGUploading /tmp/inyourcorner_web/git-ssh.sh 0.0%
INFOUploading /tmp/inyourcorner_web/git-ssh.sh 100.0%
INFO[d9afd8da] Running /usr/bin/env chmod +x /tmp/inyourcorner_web/git-ssh.sh on inyourcorneronline.com
@saqib-nadeem
saqib-nadeem / gist:ac862e8260203dae4fa7
Created June 9, 2015 06:27
Add these access control and X-Frame Allow config settings to inyourcorner_stage > config > application.rb file after line 19
config.action_dispatch.default_headers.merge!({
'Access-Control-Allow-Origin' => '*',
'Access-Control-Request-Method' => '*',
'X-Frame-Options'=>'ALLOWALL'
})
@saqib-nadeem
saqib-nadeem / 0_reuse_code.js
Last active August 29, 2015 14:19
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
Verifying myself: My Bitcoin username is +saqib. https://onename.io/saqib