Skip to content

Instantly share code, notes, and snippets.

Arnab Deka arnab

  • AWS
  • Seattle, USA
View GitHub Profile
View Travel-2018-July-Alaska-Maa-Deuta.md

July'18: Alaska Itinerary

Thu 7/19

  • Fly SEA-ANC: 9PM - 11:45 PM (3.5 hours)
  • Hotel: Anchorage: Alex Hotel and Suites near the airport

Fri 7/20

@arnab
arnab / workspace.sh
Created May 27, 2016 — forked from scottsb/casesafe.sh
Create and manage a case-sensitive disk-image on OSX.
View workspace.sh
#!/bin/bash
# ---------------------------------------------------------
# Customizable Settings
# ---------------------------------------------------------
# where to store the sparse-image
WORKSPACE=${HOME}/.workspace.dmg.sparseimage
# location where workspace will be mounted
@arnab
arnab / mac-cd-prank.sh
Created Jan 28, 2016
Prank to play on unlocked co-worker's computers. Inspired by https://twitter.com/RubyLeaders/status/626068854100332544
View mac-cd-prank.sh
cat >> ~/.zshrc
function chpwd {
echo Hodor;
if type say > /dev/null; then
say Hodor;
fi
}
# then Ctrl + D
View output.txt
$ ruby titleizer.rb
Using iterative approach: ["alexander", "the", "great"]
Using recursive approach: ["alexander", "the", "great"]
View actors.exs
defmodule Player do
def loop(name, other_player, phrase) do
receive do
{:serve} ->
IO.puts "#{name}: serving"
send(other_player, {:play_next, 1})
loop(name, other_player, phrase)
{:play_next, rally_count} ->
:timer.sleep(700)
:random.seed(:os.timestamp())
View weka_svm_classifier.rb
require "java"
require "./lib/weka.jar"
def read_data(filename)
Java::WekaCoreConverters::ConverterUtils::DataSource.new(filename).get_data_set
end
def normalize(data)
puts data.first.to_double_array.inspect
normalizer = Java::WekaFiltersUnsupervisedAttribute::Normalize.new
View feedback.org

Plash App Beta feedback

Download package name and app name should be same. I downloaded NewsAppMagazine and was looking for that after installing. Didn’t find it.

The download should be from plash.in - not a random box.com link

Login screen

Don’t need the “login” word on top of textboxes. The bottom “Login” button is prominent enough call-to-action.

Remember or Remember Me instead of Remember password

Create account screen

Placeholder text should be subtle-r

The date controls in the DOB field are not working. Shows some category dropdown, not dates.

can’t un-specify gender (even though it’s not required)

@arnab
arnab / neighbors.clj
Created Oct 11, 2013
From the Joy of Clojure, showing off the succinctness and power of Clojure.
View neighbors.clj
;; Now I know what dense means :)
(defn neighbors
([size yx] (neighbors [[-1 0] [1 0] [0 -1] [0 1]]
size yx))
([deltas size yx]
(filter (fn [new-yx]
(every? #(< -1 % size) new-yx))
(map #(vec (map + yx %))
deltas))))
View create_polls_for_tutorial.py
# python manage.py shell
from polls.models import Poll, Choice
p = Poll.objects.all()[0]
import datettime
import random
def pick_random(choices):
rand_index = random.randint(0, len(choices) - 1)
@arnab
arnab / django_kickstart.md
Last active Dec 19, 2015
Start up steps for django project
View django_kickstart.md

virtualenv and django:

PROJECT_NAME=<project_name>
mkvirtualenv $PROJECT_NAME
workon $PROJECT_NAME
pip install django
  • Verify you are using django from the virtual-env: which django-admin.py
You can’t perform that action at this time.