git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
| --[[ deepcopy.lua | |
| Deep-copy function for Lua - v0.2 | |
| ============================== | |
| - Does not overflow the stack. | |
| - Maintains cyclic-references | |
| - Copies metatables | |
| - Maintains common upvalues between copied functions (for Lua 5.2 only) | |
| TODO |
| function clone (t) -- deep-copy a table | |
| if type(t) ~= "table" then return t end | |
| local meta = getmetatable(t) | |
| local target = {} | |
| for k, v in pairs(t) do | |
| if type(v) == "table" then | |
| target[k] = clone(v) | |
| else | |
| target[k] = v | |
| end |
| Handles = {} | |
| local memoizedFuncs = {} | |
| -- metatable which does magic | |
| local mt = {} | |
| mt.__index = function(handle, key) | |
| if not handle.isValid then | |
| print(debug.traceback()) | |
| error("Error: handle is not valid!", 2) | |
| end |
| #include <sol.hpp> | |
| #include <string> | |
| #include <iostream> | |
| using EntityId = int; | |
| class Entity { | |
| public: | |
| explicit Entity(EntityId id) : | |
| name("John"), id(id) |
| local function getOS() | |
| local raw_os_name, raw_arch_name = '', '' | |
| -- LuaJIT shortcut | |
| if jit and jit.os and jit.arch then | |
| raw_os_name = jit.os | |
| raw_arch_name = jit.arch | |
| else | |
| -- is popen supported? | |
| local popen_status, popen_result = pcall(io.popen, "") |
| # How to uninstall Razer Synapse ( http://www.razerzone.com/synapse/ ) | |
| # on OS X El Capitan without using Razer's official uninstall tool. | |
| # Tested on OS X 10.11.5 in July 2016. | |
| # Step 1: In your terminal: stop and remove launch agents | |
| launchctl remove com.razer.rzupdater | |
| launchctl remove com.razerzone.rzdeviceengine | |
| sudo rm /Library/LaunchAgents/com.razer.rzupdater.plist | |
| sudo rm /Library/LaunchAgents/com.razerzone.rzdeviceengine.plist |
| #!/bin/sh | |
| set -e | |
| set -x | |
| for package in $(npm -g outdated --parseable --depth=0 | cut -d: -f3) | |
| do | |
| npm -g install "$package" | |
| done |
| var myApp = angular.module('myApp').service('CordovaNetwork', ['$ionicPlatform', '$q', function($ionicPlatform, $q) { | |
| // Get Cordova's global Connection object or emulate a smilar one | |
| var Connection = window.Connection || { | |
| "CELL" : "cellular", | |
| "CELL_2G" : "2g", | |
| "CELL_3G" : "3g", | |
| "CELL_4G" : "4g", | |
| "ETHERNET" : "ethernet", | |
| "NONE" : "none", | |
| "UNKNOWN" : "unknown", |