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 / dynamic_supervisor_example.ex
Created February 18, 2018 12:36
Simple Example for Dynamic Supervisor
defmodule Worker1 do
def start_link() do
Task.start_link(fn ->
Stream.repeatedly(fn -> :rand.uniform(1000) end)
|> Stream.each(&:timer.sleep/1)
|> Stream.each(fn _ -> IO.puts("worker 1") end)
|> Stream.run()
end)
end
end
@anildigital
anildigital / client.js
Created April 9, 2011 10:16
Twitter streaming API example twitter-node and socket.io
<!DOCTYPE HTML>
<head>
<title>Codesnippit NodeJS Twitter Tracker Client</title>
</head>
<body>
<ul></ul>
<script>
(function() {
var script = document.createElement("script");
script.src = "http://code.jquery.com/jquery.min.js";
## VSCode Setup

I use following extensions
1. Ruby
2. Ruby Solargraph
2. VTools
2. Rails Run Specs
3. Rails Go to Spec
4. Local History
5. GitLens 
@anildigital
anildigital / Person1.java
Created July 15, 2014 17:01
Shows how applying SOLID Design principles like Single Responsibility Principle (SRP) leads to many small classes. Furthermore, if you rigorously apply the Interface Segregation Principle (ISP), you'll eventually arrive at the ultimate Role Interface: an interface with a single method.
// Simple Java program
public class Person {
private int age;
private boolean isFemale;
Person(int age, boolean isFemale) {
this.age = age;
this.isFemale = isFemale;
}
#!/bin/bash
set -e
function error {
>&2 echo $1
exit 1
}
# set defaults
ffmpegParams="-strict -2"
@anildigital
anildigital / mjr2mp4.sh
Created December 20, 2017 20:24
Neeed your inputs to fix this.
#!/bin/bash
set -e
function error {
>&2 echo $1
exit 1
}
# set defaults
ffmpegParams="-strict -2"
@anildigital
anildigital / JRuby.md
Last active October 7, 2017 15:24
PuneRb - JRuby talk - Saturday, October 7th, 2017

@anildigital
anildigital / carl_hewitt_actor_model.md
Created August 11, 2017 09:14 — forked from rbishop/carl_hewitt_actor_model.md
Notes from Carl Hewitt on the Actor Model

Carl Hewitt on Actors

Actor - Fundamental unit of computation, a computation model - not just a form of concurrency

An Actor has three essential elements:

  • 1 - Processing - you have to get something done
  • 2 - Storage - you have to be able to remember things
  • 3 - Communication
@anildigital
anildigital / gist:9d56233ef8561b7eb1fc
Last active May 23, 2017 21:35
Connecting to WiFi automatically with OSMC after reboot

Steps

    1. sudo vi /etc/connman.conf
    1. Make sure you have following
   [General]
   PreferredTechnologies=wifi,ethernet

From Out of the Tar Pit:

The key problem with testing is that a test (of any kind) that uses one particular set of inputs tells you nothing at all about the behaviour of the system or component when it is given a different set of inputs. The huge number of different possible inputs usually rules out the possibility of testing them all, hence the unavoidable concern with testing will always be — have you performed the right tests?. The only certain answer you will ever get to this question is an answer in the negative — when the system breaks.

This is a strong argument for some form of generative, simulation, or property-based testing.