Skip to content

Instantly share code, notes, and snippets.

View collegeimprovements's full-sized avatar
💭
☀️

Arpit Shah collegeimprovements

💭
☀️
View GitHub Profile
@collegeimprovements
collegeimprovements / observer.md
Created January 7, 2017 14:26 — forked from pnc/observer.md
Using Erlang observer/appmon remotely

Using OTP's observer (appmon replacement) remotely

$ ssh remote-host "epmd -names"
epmd: up and running on port 4369 with data:
name some_node at port 58769

Note the running on port for epmd itself and the port of the node you're interested in debugging. Reconnect to the remote host with these ports forwarded:

$ ssh -L 4369:localhost:4369 -L 58769:localhost:58769 remote-host
@collegeimprovements
collegeimprovements / alphabets_with_elixir.ex
Created February 6, 2017 04:07
Alphabets with Elixir
IO.inspect for n <- ?A..?Z, m <- ?a..?z, do: <<m,n :: utf8>>
#["aA", "bA", "cA", "dA", "eA", "fA", "gA", "hA", "iA", "jA", "kA", "lA", "mA",
"nA", "oA", "pA", "qA", "rA", "sA", "tA", "uA", "vA", "wA", "xA", "yA", "zA",
"aB", "bB", "cB", "dB", "eB", "fB", "gB", "hB", "iB", "jB", "kB", "lB", "mB",
"nB", "oB", "pB", "qB", "rB", "sB", "tB", "uB", "vB", "wB", "xB", ...]
["aA", "bA", "cA", "dA", "eA", "fA", "gA", "hA", "iA", "jA", "kA", "lA", "mA",
"nA", "oA", "pA", "qA", "rA", "sA", "tA", "uA", "vA", "wA", "xA", "yA", "zA",
"aB", "bB", "cB", "dB", "eB", "fB", "gB", "hB", "iB", "jB", "kB", "lB", "mB",
@collegeimprovements
collegeimprovements / Advanced Bash Usage CheatSheet.md
Created March 9, 2017 11:06 — forked from projectivemotion/Advanced Bash Usage CheatSheet.md
Cheatsheet of advanced bash commands presented in Introduction to Advanced Bash Usage - James Pannacciulli. Youtube: https://youtu.be/uqHjc7hlqd0
@collegeimprovements
collegeimprovements / ticker.ex
Created May 16, 2017 13:49 — forked from minhajuddin/ticker.ex
A ticker for elixir, which emits a tick event for every interval
defmodule Ticker do
require Logger
# public api
def start(recipient_pid, tick_interval, duration \\ :infinity) do
# Process.monitor(pid) # what to do if the process is dead before this?
# start a process whose only responsibility is to wait for the interval
ticker_pid = spawn(__MODULE__, :loop, [recipient_pid, tick_interval, 0])
# and send a tick to the recipient pid and loop back
send(ticker_pid, :send_tick)
schedule_terminate(ticker_pid, duration)
const R = require("ramda");
const speakers = ["Arpit", "Ani", "Rahul"];
let sum = R.add(2, 3);
sum;
speakers;
const acctDept = {
name: "Accounts Payable",
location: "14th floor",
personnel: {
manager: {
`:kill-server`
`prefix + n,p` => to move between windows
`prefix + c` => create new windows
`prefix + d` => detach tmux
`Prefix + S` => Navigate sessions with j, k (or arrow keys)
`prefix + :new –s session_name` => create new session
`prefix + hjkl or arrow keys` => switch panes
@collegeimprovements
collegeimprovements / blog-comment.component.js
Created August 9, 2017 12:30 — forked from alexlafroscia/blog-comment.component.js
Presentation & Container Components in Ember
import Ember from 'ember';
const BlogCommentComponent = Ember.Component.extend({
});
BlogCommentComponent.reopenClass({
positionalParams: ['comment']
});
export default BlogCommentComponent;
import Ember from 'ember';
export default Ember.Component.extend({
});
@collegeimprovements
collegeimprovements / a.sh
Created August 24, 2017 11:13
Bash - 1
if [ -z $1] ; then
echo "please provide an argument"
read ARG
else
ARG=$1
fi
echo "your argument was $ARG"
@collegeimprovements
collegeimprovements / box.ex
Created August 27, 2017 19:48 — forked from teamon/box.ex
Define elixir structs with typespec with single line of code
defmodule Box do
defmacro __using__(_env) do
quote do
import Box
end
end
@doc """
Define module with struct and typespec, in single line