Skip to content

Instantly share code, notes, and snippets.

View shanbhardwaj's full-sized avatar

Shantanu Bhardwaj shanbhardwaj

  • http://www.addvalsolutions.com
  • Santa Monica, CA
View GitHub Profile
@jganzabal
jganzabal / Nvidia Titan XP + MacBook Pro + Akitio Node + Tensorflow + Keras.md
Last active November 2, 2022 11:43
How to setup Nvidia Titan XP for deep learning on a MacBook Pro with Akitio Node + Tensorflow + Keras
@bang590
bang590 / SDImageCache.m
Created October 26, 2015 13:22
Change SDWebImage cache directory
@implementation SDImageCache
...
+ (void)changeDefaultCacheDiskToDocument
{
Method origMethod = class_getInstanceMethod(self, @selector(initWithNamespace:));
Method replaceMethod = class_getInstanceMethod(self, @selector(initWithNamespaceInDocument:));
if (origMethod && replaceMethod) {
method_exchangeImplementations(origMethod, replaceMethod);
}
}
@essen
essen / http_specs.md
Last active January 10, 2022 02:01
HTTP and related specifications
@JamesChevalier
JamesChevalier / gist:6868539286a5c291522b
Created November 3, 2014 16:36
MailChimp signup in Ruby using mailchimp-api gem without double opt-in
require 'mailchimp'
mailchimp = Mailchimp::API.new(ENV['mailchimp_api_key'])
mailchimp.lists.subscribe(ENV['mailchimp_list_id'],
{ email: 'test@example.com' },
{ 'FNAME' => 'First Name', 'LNAME' => 'Last Name' },
'html',
false)
# So the format is:
# mailchimp.lists.subscribe(list_id, { email: address }, { merge_vars }, 'email type', double_optin_boolean)
require 'rails_helper'
RSpec.describe TodosController, :type => :controller do
describe "GET #index" do
#describe "POST #create" do
#describe "GET #show" do
#describe "PATCH #update" do (or PUT #update)
#describe "DELETE #destroy" do
#describe "GET #new" do
#!/usr/bin/ruby
require 'aws-sdk'
require 'mail'
# The filename for using it during the script and the location
filename = "#{Time.now.to_s.split(" ").first}_data_only_dump.sql"
store_location = "/home/your_user/your_backups/#{filename}"
# Local backup of a postgres database
`pg_dump -U your_user your_db_name -f #{store_location} --data-only`
@chrisb
chrisb / gist:4d6a09c6cc1ca2e1b14e
Last active November 25, 2022 04:15
Homebrew, Ruby, and Rails on OS X 10.10

OS X 10.10 Guide

Here's what I did to get things working.

1. Install Xcode 6

Yep, over at: https://developer.apple.com

2. Install the Command Line Tools (CLT)

@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active July 20, 2024 16:44
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@dmglab
dmglab / git_bible.md
Last active March 9, 2024 02:59
how to git

Note: this is a summary of different git workflows putting together to a small git bible. references are in between the text


How to Branch

try to keep your hacking out of the master and create feature branches. the [feature-branch workflow][4] is a good median between noobs (i have no idea how to branch) and git veterans (let's do some rocket sience with git branches!). everybody get the idea!

Basic usage examples

@wookiecooking
wookiecooking / aliases.sh
Created November 30, 2013 00:52
[Shell] Assortment of OSX influenced bash aliases and functions
# Rails Stuff
alias stoprails='kill -9 $(lsof -i :3000 -t)'
alias startrails='rails server -d'
alias restartrails='stopRails && startRails'
#Check PHP For Erroes
alias phpcheck='find ./ -name \*.php | xargs -n 1 php -l'
# ROT13-encode text. Works for decoding, too! ;)
alias rot13='tr a-zA-Z n-za-mN-ZA-M'