Skip to content

Instantly share code, notes, and snippets.

View copyninja's full-sized avatar

Vasudev Kamath copyninja

View GitHub Profile
@kkumar-fk
kkumar-fk / crypto_summary.sh
Last active February 11, 2022 03:40
Script to calculate your crypto balance, as well as give (50) historical values. Historical values help in deciding whether to invest or not.
#!/bin/bash
# Number of units of each cryptocurrency.
u_bc=0.73674311
u_eth=0.75795629
u_rip=251.065810
# Get prices of each from https://api.coingecko.com/api/v3/coins/list
bc=`curl "https://api.coingecko.com/api/v3/coins/markets?vs_currency=inr&ids=bitcoin" 2> /dev/null | jq . | grep current_price | awk '{print $NF}' | cut -d, -f1 &`
eth=`curl "https://api.coingecko.com/api/v3/coins/markets?vs_currency=inr&ids=ethereum" 2> /dev/null | jq . | grep current_price | awk '{print $NF}' | cut -d, -f1 &`
@vu3rdd
vu3rdd / inferno-osx.txt
Created February 26, 2015 05:50
Building inferno on OSX
[~/src/inferno/vitanuova/inferno]$ hg diff mkfiles/mkfile-MacOSX-386
diff -r 7ab390b860ca mkfiles/mkfile-MacOSX-386
--- a/mkfiles/mkfile-MacOSX-386 Mon Jun 30 14:13:22 2014 +0100
+++ b/mkfiles/mkfile-MacOSX-386 Thu Feb 26 11:19:09 2015 +0530
@@ -9,12 +9,12 @@
ARFLAGS= ruvs
A= a
-AS= gcc -c -arch i386 -m32
+AS= llvm-gcc -c -arch i386 -m32
@paultag
paultag / doto.hy
Created October 8, 2014 00:34
doto
#!/usr/bin/env hy3
;;; doto.hy - do something to a bunch of other things.
;;; Copyright (c) Paul R. Tagliamonte, MIT/Expat, 2014.
;;;
(import
os sys subprocess
[concurrent.futures [ThreadPoolExecutor]]
[itertools [groupby]]

Using WSME with Flask microframework

Date: 2014-06-02 20:30
slug:wsme-with-flask
tags:python, programming, wsme, rest
Authors: copyninja
summary:This is short guide on how to use wsme with Flask applications, writing this because I felt documentation is lacking.
@hausen
hausen / gist:9501041
Last active August 29, 2015 13:57
"Fixing" xkcd 1340 (or making the most redonkulous clock ever)

"Fixing" xkcd 1340 (or making the most redonkulous clock ever)

Update: feeling adventurous? Clone or fork the xkcd clock! If you just want to see it in action or get a glimpse of how it works, keep reading.

Problem

The date in [xkcd's comic number 1340][1] [does not change][2].

language filename
hy
learn-hy.hy
;; this gives an gentle introduction to hy for a quick trial head to
;; try-hy.appspot.com
;;
@Willyfrog
Willyfrog / gist:7384126
Created November 9, 2013 10:33
Common lisp function for reading input, usefull for hakerrank challenges
(defun get-hr-parameters (&optional (coerce #'identity))
"gets all the parameters and puts them in a list"
(loop
for input-line = (read-line t nil :eof)
until (eq input-line :eof)
collect (funcall coerce input-line)))
@raine
raine / .gitconfig
Last active December 17, 2015 16:09
A git alias for fixing (or "amending") an earlier commit in the history.
; 1. Stage the changes you want to have amended to the earlier commit
; 2. `$ git fix <revision>` (e.g. `git fix HEAD~4`or `git fix bbfba98`)
[alias]
fix = "!_() { c=$(git rev-parse $1) && git commit --fixup $c && if grep -qv \"No local changes\" <<<$(git stash); then s=1; fi; git -c core.editor=cat rebase -i --autosquash $c~; if [[ -n "$s" ]]; then git stash pop; fi; }; _"
@creaktive
creaktive / rainbarf.zsh
Last active January 27, 2023 18:44
rainbarf sans tmux (to enable, "source rainbarf.zsh", under zsh)
# abort if already under tmux
[[ -n $TMUX_PANE ]] && return
# zsh-specific includes
zmodload -i zsh/datetime
zmodload -i zsh/stat
# place to store the chart
RAINBARF_OUT=~/.rainbarf.out
# update period, in seconds
@aravindavk
aravindavk / sms-trends-android
Created April 8, 2013 18:22
SMS trends from Android phone