Paprika doesn't have their API documented, so this is me reverse-engineering it from an Android device
This file contains hidden or 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
| (defn tree-seq-depth | |
| "Returns a lazy sequence of vectors of the nodes in a tree and their | |
| depth as [node depth], via a depth-first walk. branch? must be a fn | |
| of one arg that returns true if passed a node that can have | |
| children (but may not). children must be a fn of one arg that | |
| returns a sequence of the children. Will only be called on nodes for | |
| which branch? returns true. Root is the root node of the tree." | |
| [branch? children root] | |
| (let [walk (fn walk [depth node] | |
| (lazy-seq |
This file contains hidden or 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
| import Map; | |
| class OrderedMapIterator<K,V> { | |
| var map : OrderedMap<K,V>; | |
| var index : Int = 0; | |
| public function new(omap:OrderedMap<K,V>) | |
| map = omap; | |
| public function hasNext() : Bool |
This file contains hidden or 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
| // LogResponseWritter wraps the standard http.ResponseWritter allowing for more | |
| // verbose logging | |
| type LogResponseWritter struct { | |
| status int | |
| size int | |
| http.ResponseWriter | |
| } | |
| // func NewMyResponseWriter(res http.ResponseWriter) *MyResponseWriter { | |
| // // Default the status code to 200 |
This file contains hidden or 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
| import React, { Component, PropTypes } from 'react' | |
| import ReactDOM from 'react-dom' | |
| import throttle from 'lodash/throttle' | |
| import { INTERVAL } from './constants.js' | |
| let bound // are the event handlers bound? | |
| let current // current scroll position, from top of document | |
| let queue // array of React Components to check |
This file contains hidden or 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
| import haxe.macro.Context; | |
| import haxe.macro.Expr; | |
| import haxe.macro.TypeTools; | |
| #if !macro | |
| @:genericBuild(PartialMacro.build()) | |
| #end | |
| class Partial<T> {} | |
| class PartialMacro { |
This file contains hidden or 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
| # The initial version | |
| if [ ! -f .env ] | |
| then | |
| export $(cat .env | xargs) | |
| fi | |
| # My favorite from the comments. Thanks @richarddewit & others! | |
| set -a && source .env && set +a |
This file contains hidden or 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
| def multipart_encoder(params, files): | |
| boundry = uuid.uuid4().hex | |
| lines = list() | |
| for key, val in params.items(): | |
| if val is None: continue | |
| lines.append('--' + boundry) | |
| lines.append('Content-Disposition: form-data; name="%s"'%key) | |
| lines.extend([ '', val ]) | |
| for key, uri in files.items(): |