Skip to content

Instantly share code, notes, and snippets.

View GauravShetty1016's full-sized avatar

Gaurav Shetty GauravShetty1016

View GitHub Profile
@GauravShetty1016
GauravShetty1016 / launch.sh
Created September 13, 2020 22:09 — forked from ltfschoen/launch.sh
Shell script that generates separate Terminal tabs to run a Ruby on Rails web server then automatically opens associated webpage in your web browser
#!/bin/bash
# File: ~/launch.sh
# Original Code Reference: http://dan.doezema.com/2013/04/programmatically-create-title-tabs-within-the-mac-os-x-terminal-app/
# New-BSD License by Original Author Daniel Doezema http://dan.doezema.com/licenses/new-bsd/
# Modified by Luke Schoen in 2017 to include loading new tabs for Rails Server and automatically open webpage in browser.
# References: https://developer.apple.com/library/content/documentation/AppleScript/Conceptual/AppleScriptLangGuide/introduction/ASLR_intro.html
@GauravShetty1016
GauravShetty1016 / keyboard_toggle.sh
Created September 4, 2017 10:46
Script to get toggle keyboard backlight on an ASUS ROG 752 in Ubuntu
# Turn on
echo 2 | sudo tee /sys/class/leds/asus::kbd_backlight/brightness
#turn off
echo 0 | sudo tee /sys/class/leds/asus::kbd_backlight/brightness
source :rubygems
# We are not loading Active Record, nor Active Resources etc.
# We can do this in any app by simply replacing the rails gem
# by the parts we want to use.
gem "actionpack", "~> 3.2"
gem "railties", "~> 3.2"
gem "tzinfo"
# Let's use thin
@GauravShetty1016
GauravShetty1016 / router_workaround.js
Created May 26, 2012 12:34
Workaround for the Ember router browser buttons issue
Ember.Application.reopen({
setupStateManager: function(stateManager) {
var location = Ember.get(stateManager, 'location');
if (typeof location === 'string') {
location = Ember.Location.create({implementation: location});
Ember.set(stateManager, 'location', location);
}