Skip to content

Instantly share code, notes, and snippets.

View arvi's full-sized avatar
🎯
Focusing

arvi

🎯
Focusing
View GitHub Profile
@arvi
arvi / OkHttpStack.java
Created November 30, 2016 05:03 — forked from NightlyNexus/OkHttpStack.java
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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@arvi
arvi / promise-dot-all.js
Created April 23, 2018 05:47 — forked from indiesquidge/promise-dot-all.js
Recreating Promise.all with async/await
/*
Let us re-create `Promise.all`
`Promise.all` method returns a promise that resolves when all of the promises in the iterable argument have resolved,
or rejects with the reason of the first passed promise that rejects.
Read more about `Promise.all` on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all
A basic example would be something like this:
@arvi
arvi / remove_brew-mongo_osx.sh
Created January 20, 2018 08:48 — forked from katychuang/remove_brew-mongo_osx.sh
remove mongodb that was installed via brew
#!/usr/bin/env sh
# checks to see if running
launchctl list | grep mongo
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist
launchctl remove homebrew.mxcl.mongodb
pkill -f mongod
@arvi
arvi / client.js
Created August 30, 2016 09:21 — forked from crtr0/client.js
A simple example of setting-up dynamic "rooms" for socket.io clients to join
// set-up a connection between the client and the server
var socket = io.connect();
// let's assume that the client page, once rendered, knows what room it wants to join
var room = "abc123";
socket.on('connect', function() {
// Connected, let's sign-up for to receive messages for this room
socket.emit('room', room);
});
@arvi
arvi / Instructions.md
Last active April 27, 2017 07:13 — forked from dionysius/Instructions.md
Setup launcher icon (.desktop file) for AMPPS. Tested for elementaryOS freya, but should work with most ubuntu derivates.

Fix/Create AMPPS Launcher icon (.desktop file)

Install AMPPS with default options (at this time of writing there are no options). Expecting it is installed in /usr/local/ampps/*

Since its important to place the new files at specific locations, you need to adapt the filename as requested. All files are owned by root.

ampps_starter: place this file exactly as /usr/local/bin/ampps and make it executable

ampps_bootstrapper:

@arvi
arvi / SimpleStore.js
Created September 8, 2016 05:37 — forked from ksafranski/SimpleStore.js
Simple localStorage function with Cookie fallback for older browsers.
/**
* Simple localStorage with Cookie Fallback
* v.1.0.0
*
* USAGE:
* ----------------------------------------
* Set New / Modify:
* store('my_key', 'some_value');
*
* Retrieve:
@arvi
arvi / flightplan-deploy.md
Created July 1, 2016 08:33 — forked from learncodeacademy/flightplan-deploy.md
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
@arvi
arvi / deployUser.md
Created July 1, 2016 07:40 — forked from learncodeacademy/deployUser.md
Adding a deploy user in Linux

(wherever it says url.com, 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

# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management