Skip to content

Instantly share code, notes, and snippets.

View anildigital's full-sized avatar
:octocat:

Anil Wadghule anildigital

:octocat:
View GitHub Profile
@anildigital
anildigital / DefaultKeyBinding.dict
Last active May 19, 2017 07:25 — forked from anonymous/DefaultKeyBinding.dict
Create this file ~/Library/KeyBindings/DefaultKeyBinding.dict
{
"\UF729" = moveToBeginningOfParagraph:; // home
"\UF72B" = moveToEndOfParagraph:; // end
"$\UF729" = moveToBeginningOfParagraphAndModifySelection:; // shift-home
"$\UF72B" = moveToEndOfParagraphAndModifySelection:; // shift-end
// Emacs keybindings
"^ " = "setMark:";
"~d" = "deleteWordForward:";
"~w" = "copy:"; /* M-w */
"^w" = "deleteWordBackward:";
@anildigital
anildigital / libnice.rb
Created April 20, 2017 10:08
libnice formula (required by Janus Gateway)
class Libnice < Formula
desc "GLib ICE implementation"
homepage "https://wiki.freedesktop.org/nice/"
url "https://nice.freedesktop.org/releases/libnice-0.1.7.tar.gz"
sha256 "4ed165aa2203136dce548c7cef735d8becf5d9869793f96b99dcbbaa9acf78d8"
depends_on "pkg-config" => :build
depends_on "glib"
depends_on "gstreamer"
@anildigital
anildigital / fix_bad_fstab.txt
Created April 18, 2017 11:33
When you mess up with fstab (When your root becomes Read-only file system)
sudo mount -t tmpfs -o size=512M tmpfs /any_existing_dir_path
cd /any_existing_dir_path
cp /etc/fstab fstab
vi fstab
# Remove wrong fstab entry
sudo mount -T fstab -o remount,rw /dev/xvda1 /
sudo vim /etc/fstab
reboot
# Done
@anildigital
anildigital / setup.md
Created February 21, 2017 17:48
My acoustic setup
  • RHA MA750i (My daily driver)
  • ATH M50x (Listen sometimes at Home)
  • SONOS PLAY:1 (Regularly use it, mostly for Apple Music streaming, Beats 1 Radio)
  • FiiO A1 Portable Headphone Amplifier (Use it but not so frequently)
  • FiiO E11K (A3) Kilimanjaro 2 - (Use it with M50X but not so frequently)
  • Sony HT-RT3 5.1ch Home Theatre System with Bluetooth® (Use it actively with Apple TV [4th generation] & Sony PS4)
  • Sony NW-A35 Walkman (Got it recently and heavily using it)

I have collection of FLAC & 24bit music. I have almost complete A.R. Rahman FLAC collection, along with many other albums.

require 'concurrent'
event = Concurrent::Event.new
t1 = Thread.new do
puts "t1 is waiting"
event.wait(1)
puts "event ocurred"
end
@anildigital
anildigital / gist:4fae9b51f1d416504899
Created July 26, 2015 17:44
Docker desktop on OSX
# https://github.com/docker/docker/issues/8710
brew install socat
brew cask install xquartz
open -a XQuartz
socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\"
# in another window
docker run -e DISPLAY=192.168.59.3:0 jess/geary
@anildigital
anildigital / stay_up_to_date_in_programming.md
Created March 17, 2016 14:02
Stay up to date in programming world
public void convertToXml(AnyObject object)
throws JAXBException, FileNotFoundException
{
JAXBContext contextObj = JAXBContext.newInstance( PnrRetrieveResult.class);
Marshaller marshallerObj = contextObj.createMarshaller();
marshallerObj.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
marshallerObj.marshal(object, new FileOutputStream( "/tmp/result.xml"));
System.out.println("Done ");
}
BUFFER_SIZE = 100
semaphore = Mutex.new
require 'thread'
queue = Thread::Queue.new
class Item
attr_reader :data
def initialize
@anildigital
anildigital / gist:1245371
Created September 27, 2011 15:26
Generate Emacs Ctags file for Ruby projects
ctags -e -a --Ruby-kinds=-f -o TAGS -R .