Skip to content

Instantly share code, notes, and snippets.

View trap_basic
trap 'echo hello' INT
# Output:
# % bash trap_basic
# ^Chello
# ^Chello
# ^Chello
# ^Chello
View Source.hs
main = do
firstName <- getLine
print firstName
-- Functors apply a function that takes a value and returns a value to a
-- wrapped value.
class Functor c where
fmap :: (a -> b) -> c a -> c b
($) :: c a -> (a -> b) -> c b
#!/usr/bin/env bash
set -e
# Updates the DNS record for a domain, if the domain's
# resolved IP does not match the external IP of the machine running this program.
usage() {
echo "usage: <domain>"
exit 1
View jsbin.bazisoyopa.1.html
<!DOCTYPE html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
ul {
background: red; /* purely for visualizing */
nishanths / minima.xml
Created November 25, 2017 22:13 — forked from jiskandar/minima.xml
this is minima stretch blogger template
View minima.xml
<!DOCTYPE html>
<b:if cond='data:blog.url == data:blog.homepageUrl'>
<b:include data='blog' name='all-head-content'/>
<meta content='your-keyword-here' name='keywords'/>
<b:if cond='data:blog.pageType == &quot;item&quot;'>
<title><data:blog.pageName/> - <data:blog.title/></title>
View hack-repro.js
window.onload = () => {
var iframe = document.querySelector("iframe");
var container = iframe.contentDocument.querySelector(".container");
var d = iframe.contentDocument.querySelector(".d");
var hackForceRecompute = () => {
// Any one of the following is sufficient.
nishanths /
Last active March 23, 2016 03:02
Fix DataNode not running
# The MIT License (MIT)
# Copyright (c) 2016 Nishanth Shanmugham
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
nishanths / main.js
Last active August 7, 2019 23:46
Electron tray: Drag and Drop events demo
View main.js
var app = require('app');
var Menu = require('menu');
var Tray = require('tray');
var appIcon = null;
app.on('ready', function(){
// image is null, so image will not be shown in menu bar
// so click around on the system menu bar to locate the space where the tray icon is
appIcon = new Tray(null);

Falsy values

  • false
  • null
  • undefined
  • +0, -0, NaN, 0n
  • "" (empty string)
  • document.all in browser environments

Values not on this list are truthy.


Keybase proof

I hereby claim:

  • I am nishanths on github.
  • I am nishanths ( on keybase.
  • I have a public key whose fingerprint is 73F1 FF0F 0976 4B2C 3CE2 10F7 B81C 887F F8EA EA9B

To claim this, I am signing this object: