Skip to content

Instantly share code, notes, and snippets.

View AnwarShah's full-sized avatar

Anwar AnwarShah

View GitHub Profile
@AnwarShah
AnwarShah / railscasts.rb
Last active August 29, 2015 14:27 — forked from samqiu/railscasts.rb
Download free Railscast video
#!/usr/bin/ruby
require 'rss'
# Usage
# $ ./railscasts.rb http://railscasts.com/subscriptions/YOURRAILSCASTRSS/\/
# episodes.rss
# OR
# $ ./railscasts.rb
p 'Downloading rss index'
@AnwarShah
AnwarShah / zsh.md
Last active August 29, 2015 14:27 — forked from tsabat/zsh.md
Getting oh-my-zsh to work in Ubuntu
@AnwarShah
AnwarShah / application.css.scss
Created November 1, 2015 15:40 — forked from victorbstan/application.css.scss
Overriding will_paginate gem to provide a drop-down select html tag list for all the page.
.pagination {
display:inline-block;
form {
display: inline-block;
margin:0;
select {
width:100px;
}
}
}
@AnwarShah
AnwarShah / capybara cheat sheet
Created January 18, 2016 06:29 — 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')
@AnwarShah
AnwarShah / rspec_rails_cheetsheet.rb
Created February 21, 2017 19:35 — forked from them0nk/rspec_rails_cheetsheet.rb
Rspec Rails cheatsheet (include capybara matchers)
#Model
@user.should have(1).error_on(:username) # Checks whether there is an error in username
@user.errors[:username].should include("can't be blank") # check for the error message
#Rendering
response.should render_template(:index)
#Redirecting
response.should redirect_to(movies_path)
@AnwarShah
AnwarShah / jdk_download.sh
Created April 12, 2017 16:14 — forked from P7h/jdk_download.sh
Script to download JDK / JRE / Java binaries from Oracle website from terminal / shell / command line / command prompt
##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### #####
### Shell script to download Oracle JDK / JRE / Java binaries from Oracle website using terminal / command / shell prompt using wget.
### You can download all the binaries one-shot by just giving the BASE_URL.
### Script might be useful if you need Oracle JDK on Amazon EC2 env.
### Script is updated for every JDK release.
### Features:-
# 1. Resumes a broken / interrupted [previous] download, if any.
# 2. Renames the file to a proper name with including platform info.
@AnwarShah
AnwarShah / ffmpeg.md
Created July 20, 2019 11:26 — forked from protrolium/ffmpeg.md
using ffmpeg to extract audio from video files

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:

@AnwarShah
AnwarShah / sublime-text-3.desktop
Created December 12, 2015 14:23 — forked from thebinarypenguin/sublime-text-2.desktop
A desktop application launcher for Sublime Text 3
[Desktop Entry]
Type=Application
Terminal=false
StartupNotify=true
Name=Sublime Text 3
Name[en_US]=Sublime Text 3
GenericName=Text Editor
GenericName[en_US]=Text Editor
Comment=Edit text files
Comment[en_US]=Edit text files