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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 &` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[~/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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]] |
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.
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
;;
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; 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; }; _" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python2 | |
import datetime | |
import subprocess | |
import sys | |
import time | |
start_date=datetime.date(2012,11,1) | |
end_date = datetime.date(2013, 04, 9) |
NewerOlder