Navigation Menu

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 / cleanup_swap.md
Last active April 9, 2024 15:52
Cleanup swap space on macOS

To see current swap usage

sysctl -a | grep swap

Use only when when your system is in a very bad shape

$ sudo pkill -HUP -u _windowserver 

List of companies using Ruby on Rails

  • figma.com
  • tesla.com (Tesla motors)
  • meetup.com
  • dribbble.com
  • fiverr.com
  • basecamp.com
  • notonthehighstreet.com
  • goodreads.com
@anildigital
anildigital / install_janus.sh
Created April 7, 2017 10:00
Install Janus WebRTC Gateway on macOS
brew install jansson libnice openssl libusrsctp libmicrohttpd libwebsockets cmake rabbitmq-c sofia-sip opus libogg glib pkg-config gengetopt
wget https://github.com/cisco/libsrtp/archive/v1.5.4.tar.gz
tar xvf v1.5.4.tar.gz
cd libsrtp-1.5.4
./configure --prefix=/usr/local/libsrtp
make
sudo make install
git clone git@github.com:meetecho/janus-gateway.git
@anildigital
anildigital / gist:862675ec1b7bccabc311
Created July 26, 2014 18:27
Remove dangling docker images
docker rmi $(docker images -q -f dangling=true)
@anildigital
anildigital / user_system_real.md
Created September 20, 2011 18:30
Ruby Benchmark module: meanings of “user”, “system”, and “real”?

Ruby Benchmark module: meanings of “user”, “system”, and “real”?

>> Benchmark.bm(7) { |b| b.report('Report:') { s = '' ; 10000.times { s += 'a' } }  }
			 user     system      total        real
Report:  0.150000   0.010000   0.160000 (  0.156361)

These are the same times that the Unix time command or other typical benchmarking tools would report:

user: the amount of time spent executing userspace code (i.e.: your code),

@anildigital
anildigital / gist:410309
Created May 22, 2010 19:41 — forked from defunkt/gist:206253
Awesome unicorn config.
# unicorn_rails -c /data/github/current/config/unicorn.rb -E production -D
rails_env = ENV['RAILS_ENV'] || 'production'
# 16 workers and 1 master
worker_processes (rails_env == 'production' ? 16 : 4)
# Load rails+github.git into the master before forking workers
# for super-fast worker spawn times
preload_app true
@anildigital
anildigital / run_languagetool_with_docker.md
Created February 24, 2021 07:29
How to replace Grammarly with LanguageTool for free!

Steps

Install LanguageTool Docker container

docker run -d --rm -p 8010:8010 erikvl87/languagetool

Install LanguageTool browser extension

@anildigital
anildigital / README
Created May 4, 2020 16:57 — forked from mremond/README
Phoenix Elixir framework with ejabberd - Tutorial
Please read original blog post for reference:
http://blog.process-one.net/embedding-ejabberd-into-an-elixir-phoenix-web-application/
{
"\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:";
{
"variables": {
"aws_access_key": "",
"aws_secret_key": "",
"region": "us-east-1"
},
"builders": [
{
"access_key": "{{user `aws_access_key`}}",
"ami_name": "packer-linux-janus-{{timestamp}}",