Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

arvi

  • Laguna, Philippines
View GitHub Profile
@arvi
arvi / employee-update.js
Created Oct 3, 2018
employee-update.js
View employee-update.js
switch (idType) {
case 'national':
case 'iqama':
case 'visa':
if (isPrimaryId) {
form.append('id_type', idType);
form.append('id_number', idNumber);
form.append('id_issuing_country', idIssuingCountry);
form.append('id_expiration', idExpiration);
View promises.js
function hello() {
return new Promise(function(resolve, reject) {
resolve('hello')
});
}
function helloThere() {
return 'helloThere';
}
@arvi
arvi / cloudSettings
Last active Aug 25, 2018
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2018-08-15T02:19:22.547Z","extensionVersion":"v3.0.0"}
@arvi
arvi / promise-dot-all.js
Created Apr 23, 2018 — forked from indiesquidge/promise-dot-all.js
Recreating Promise.all with async/await
View promise-dot-all.js
/*
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 Jan 20, 2018 — forked from katychuang/remove_brew-mongo_osx.sh
remove mongodb that was installed via brew
View remove_brew-mongo_osx.sh
#!/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 / Instructions.md
Last active Apr 27, 2017 — forked from dionysius/Instructions.md
Setup launcher icon (.desktop file) for AMPPS. Tested for elementaryOS freya, but should work with most ubuntu derivates.
View Instructions.md

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 / OkHttpStack.java
Created Nov 30, 2016 — forked from NightlyNexus/OkHttpStack.java
OkHttp 3 implementation of Volley's HttpStack
View OkHttpStack.java
/*
* 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 / sublime-settings-osx.json
Last active Feb 22, 2019
Sublime Settings OSX
View sublime-settings-osx.json
{
"auto_complete_triggers":
[
{
"characters": "<",
"selector": "text.html"
},
{
"characters": ".",
"selector": "source.js"
@arvi
arvi / sublime-installation-update.md
Created Sep 27, 2016
How to install/update Sublime Text (Elementary OS Freya / Ubuntu)
View sublime-installation-update.md
  1. Remove existing sublime text editor
  • sudo apt-get remove sublime-text-installer

Download the package and drag the file to the terminal

  • sudo dpkg -i '/home/usernamehere/Downloads/sublime-text_build-3126_amd64.deb'

OR Direct

View geolocation.js
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position){
var latitude = position.coords.latitude;
var longitude = position.coords.longitude;
var accuracy = position.coords.accuracy; console.log(latitude, longitude, accuracy); /*
var coords = new google.maps.LatLng(latitude, longitude);
var mapOptions = {
zoom: 15,
center: coords,
mapTypeControl: true,
You can’t perform that action at this time.