Skip to content

Instantly share code, notes, and snippets.



  • Laguna, Philippines
View GitHub Profile
junxie6 /
Last active Nov 11, 2016 — forked from lezorich/
Android basic persistent cookie manager for Volley. This cookie store wraps the default CookieManager store to store the session cookie. It use's Gson to json serialize the cookie and store it as a json string in SharedPreferences.
* The MIT License (MIT)
* Copyright (c) 2015 Lukas Zorich
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
beilly /
Last active Feb 13, 2017
Volley Stack with OkHttp3,and it will trusting all certificates. You can remove "allowAllSSLOkHttp(builder);" if you do't want to trusting all.
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.ProtocolVersion;
import org.apache.http.StatusLine;
NightlyNexus /
Created May 13, 2016
OkHttp 3 implementation of Volley's HttpStack
* Copyright (C) 2016 Eric Cochran
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Unless required by applicable law or agreed to in writing, software
cayasso / index.js
Created May 30, 2017
Bulk writes in mongoose
View index.js
const mongoose = require('mongoose')
const { Types, Schema } = mongoose
// Connect to mongo
// Set model schema
const ArticleSchema = new Schema({
title: {
type: String,
benvium /
Created Aug 29, 2014
Fairly simply Retrofit custom error handling example. Is set up so that you don't need to do much work in the 'failure' handler of a retrofit call to get the user-visible error message to show. Works on all endpoints. There's lots of exception handling as our server folks like to keep us on our toes by sending all kinds of random stuff..!
// on error the server sends JSON
{ "error": { "data": { "message":"A thing went wrong" } } }
// create model classes..
public class ErrorResponse {
Error error;
ksafranski / SimpleStore.js
Last active Feb 4, 2021
Simple localStorage function with Cookie fallback for older browsers.
View SimpleStore.js
* Simple localStorage with Cookie Fallback
* v.1.0.0
* ----------------------------------------
* Set New / Modify:
* store('my_key', 'some_value');
* Retrieve:
learncodeacademy /
Last active Mar 24, 2021
Adding a deploy user in Linux

(wherever it says, use your server's domain or IP)

Login to new server as root, then add a deploy user

sudo useradd --create-home -s /bin/bash deploy
sudo adduser deploy sudo
sudo passwd deploy

And Update the new password

loorlab / disable_zlib.output_compression
Last active Mar 30, 2021
Disable zlib.output_compression on WordPress : Notice: ob_end_flush(): failed to send buffer of zlib output compression (1) in /path/wp-includes/functions.php on line 3282 via
View disable_zlib.output_compression
SOLUTIONS I have came across so far:
======================== SOLUTION 1 ====================
In plugins (or somewhere) you probably have this code:
ini_set('zlib.output_compression', '1');
so, I replaced that code with
vikas5914 / log.js
Last active May 4, 2021
Custom Logger Library with winston
View log.js
const { createLogger, format, transports } = require('winston')
const moment = require('moment')
// set default log level.
const logLevel = 'info'
var logger = createLogger({
level: logLevel,
levels: {
fatal: 0,
learncodeacademy /
Last active May 12, 2021
Deploy Node.js Apps with Flightplan

##Setup your server (this would ideally be done with automated provisioning)

  • add a deploy user with password-less ssh see this gist
  • install forever npm install -g forever

##Install flightplan

  • npm install -g flightplan
  • in your project folder npm install flightplan --save-dev
  • create a flightplan.js file