I hereby claim:
- I am dkordik on github.
- I am dkordik (https://keybase.io/dkordik) on keybase.
- I have a public key ASCAO4KMq8wsMpPZ5vs5rGvZlxNk75PYkdjOGO1nlafjFwo
To claim this, I am signing this object:
#!/usr/bin/env /usr/local/bin/node | |
// <xbar.title>Current ISP name</xbar.title> | |
// <xbar.version>v2.1.7-beta</xbar.version> | |
// <xbar.author>Dan Kordik</xbar.author> | |
// <xbar.author.github>dkordik</xbar.author.github> | |
// <xbar.desc>Displays current ISP name</xbar.desc> | |
// <xbar.dependencies></xbar.dependencies> | |
const http = require("http"); |
const date = new Date("2022-06-27T00:49:00Z"); | |
// yoinked from https://flaviocopes.com/how-to-list-object-methods-javascript/ | |
const getMethods = (obj) => { | |
let properties = new Set() | |
let currentObj = obj | |
do { | |
Object.getOwnPropertyNames(currentObj).map(item => properties.add(item)) | |
} while ((currentObj = Object.getPrototypeOf(currentObj))) | |
return [...properties.keys()].filter(item => typeof obj[item] === 'function') |
class BulkResponse { | |
String subject; | |
} | |
bulkResponse = new BulkResponse(subject:'Hi Rohit!') | |
//-- | |
class ThreadResponse extends BulkResponse { | |
String campaignName; | |
} |
#!/bin/bash | |
set -e # exit when a command fails, so we don't continue doing next steps! | |
function check_exists { | |
CMD="$1" | |
# "type" works nicely for checking existence of both shell functions and scripts/bins | |
if type -t "$CMD" 1> /dev/null 2>/dev/null; then | |
true | |
else | |
false |
#uses showlinenum.awk from: https://github.com/jay/showlinenum (needs gawk, brew install gawk) | |
alias gd='git diff --color=always | ~/showlinenum.awk color_line_number=90 color_separator=37 | less -r' | |
alias gds='git diff --staged --color=always | ~/showlinenum.awk color_line_number=90 color_separator=37 | less -r' |
# Usage: | |
# ./time_command.sh "sleep 2" | |
# (or a command you actually care about timing, in quotes) | |
COMMAND="$1" | |
for N in {1..10} | |
do | |
printf "$N: " | |
( time `eval $COMMAND` ) 2>&1 | grep real | awk '{ printf $2 }' |
I hereby claim:
To claim this, I am signing this object:
<link rel="import" href="../core-scaffold/core-scaffold.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<link rel="import" href="../core-menu/core-menu.html"> | |
<link rel="import" href="../core-item/core-item.html"> | |
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-field/core-field.html"> | |
<link rel="import" href="../core-icon/core-icon.html"> | |
<link rel="import" href="../core-input/core-input.html"> | |
<link rel="import" href="../core-icons/core-icons.html"> |
var Future = Npm.require('fibers/future'); //npm install fibers | |
var async = function (callback) { //let's tuck away some of the nastyness in here | |
var future = new Future(); | |
var returnFunc = function () { | |
future["return"].apply(future, arguments); | |
} | |
callback(returnFunc); |
//image error events don't bubble, so we use | |
// native event capturing, where supported | |
if (document.addEventListener && !document.bubbleErrors) { | |
document.addEventListener('error', function (event) { | |
jQuery(event.target).trigger(event); //bubble it ourselves! | |
}, true); //true = use event capturing (not bubbling) | |
document.bubbleErrors = true; | |
} |