Skip to content

Instantly share code, notes, and snippets.

@daopk
daopk / git-config-http-version.md
Last active May 2, 2024 01:38
Fix error : RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)
git config --global http.version HTTP/1.1
git config --global http.postBuffer 157286400
@kachayev
kachayev / concurrency-in-go.md
Last active March 11, 2024 11:27
Channels Are Not Enough or Why Pipelining Is Not That Easy
@szehnder
szehnder / DataProvider.swift
Last active December 23, 2019 12:13
Pattern for async callback between a view controller and a dataprovider singleton
typealias ServiceResponse = (NSDictionary?, NSError?) -> Void
class DataProvider: NSObject {
var client:AFHTTPRequestOperationManager?
let LOGIN_URL = "/api/v1/login"
class var sharedInstance:DataProvider {
struct Singleton {
static let instance = DataProvider()
@James1x0
James1x0 / momentjs.humanized.triplesplit.time.js
Created January 15, 2014 19:42
Get a humanized, "Morning", "Afternoon", "Evening" from moment.js **Great for user greetings!**
function getGreetingTime (m) {
var g = null; //return g
if(!m || !m.isValid()) { return; } //if we can't find a valid or filled moment, we return.
var split_afternoon = 12 //24hr time to split the afternoon
var split_evening = 17 //24hr time to split the evening
var currentHour = parseFloat(m.format("HH"));
if(currentHour >= split_afternoon && currentHour <= split_evening) {