Skip to content

Instantly share code, notes, and snippets.

Life happened. I now have varied interests. I may be slow to respond.

Akash Manohar HashNuke

Life happened. I now have varied interests. I may be slow to respond.
View GitHub Profile
View combine-flatMap-reduce-tryout.swift
import Combine
import Foundation
import PlaygroundSupport
PlaygroundPage.current.needsIndefiniteExecution = true
var publisher = PassthroughSubject<Int, Error>()
let cancellable = publisher
.flatMap { Just($0).setFailureType(to: Error.self) }
HashNuke / SwiftUI-SplitView-MacOS.swift
Last active May 14, 2022
Using a NSSplitViewController with SwiftUI on mac to render SwiftUI views as split panes. Drop this code into a playground to try it out. SORRY MAC-OS ONLY. DOES NOT WORK ON IOS
View SwiftUI-SplitView-MacOS.swift
import AppKit
import SwiftUI
// Delete this line if not using a playground
import PlaygroundSupport
struct ContentView: View {
var body: some View {
// if spacing is not set to zero, there will be a gap after the first row

Keybase proof

I hereby claim:

  • I am hashnuke on github.
  • I am hashnuke ( on keybase.
  • I have a public key ASCYpt4PklMYqN6rB6wy0mf9_rBfUepaKcY3u8GYNeb1QQo

To claim this, I am signing this object:

HashNuke /
Last active Nov 29, 2015
node-gyp on small servers

node-gyp on small servers

node-gyp needs more ram or swap space to install. Use these commands to create swap space as root. (if using sudo, then put the following in a file and then run it using sudo).

Assumes you have Ubuntu. Should work for most Debian-based OSes.

These are quick copy-paste commands to create 2gb swap space. Look at the end for info.

# feel free to change below values
HashNuke / index.html
Created Oct 29, 2015
Buildings and the moon OR a bar chart
View index.html
<!doctype html>
<title>Buildings and the moon OR a bar chart</title>
<script src="" charset="utf-8"></script>
View phoenix.release.ex
defmodule Mix.Tasks.Phoenix.Release do
use Mix.Task
@shortdoc "Creates a release using exrm"
def run(args) do
Application.put_env(:phoenix, :serve_endpoints, true, persistent: true) "release", args
HashNuke / circle-ci-elixir-config
Created Jun 15, 2015
expected CircleCI config-for-elixir
View circle-ci-elixir-config
PATH: "$HOME/.asdf/bin:$HOME/.asdf/shims:$PATH"
- redis
- ~/.asdf
- if ! asdf | grep version; then git clone ~/.asdf; fi
View tryout.exs
defmodule Tryout do
def hello(name \\ "akash")
def hello(name) do
IO.puts name
Tryout.hello #=> akash
Tryout.hello("nuke") #=> nuke
HashNuke / fantastic_rotors.ex
Created Oct 4, 2014
INCOMPLETE - WORK IN PROGRESS. Supposed to be used as Fantastic.Rotors.start(options)
View fantastic_rotors.ex
defmodule Fantastic.Rotors do
import Rotor.BasicRotors
import CoffeeRotor
import SassRotor
# NOT TESTED won't work
# TODO digested output has to be stored in the application env, as a map, so that it's accessible in the templates.
# so the hash would contain %{"file name" => "digest"}
View rotor-example.exs :all_files_in_project_root, ["*"], fn(changed, all)->
IO.inspect changed
IO.inspect "ALL FILES"
IO.inspect all
# Options can be passed as a 4th arg after the rotor function.
# Currently available option is `interval`.
# Default polling interval is 2500 (2.5 seconds).