Skip to content

Instantly share code, notes, and snippets.

View mainanick's full-sized avatar
🌴

Maina Nick mainanick

🌴
  • Nairobi, Kenya
  • 01:26 (UTC +03:00)
View GitHub Profile
import os
import sys
from django.conf import settings
from django.contrib import messages
from django.http import HttpResponse, HttpResponseNotAllowed
from django.shortcuts import redirect
from django.urls import path
from django.template import Template, RequestContext
from django.views.decorators.http import require_GET
var Command = (function() {
return function(command, args) {
console.log("Dispatch", command);
};
})();
Command("start", { test: 6 });
const has = (obj, key) => Object.hasOwnProperty.call(obj, key);
let deepCopy = (obj, res) => {
let keys = Object.keys(obj);
let result = res || {};
keys.forEach(key => {
if ('object' != typeof obj[key] && has(obj, key)) {
result[key] = obj[key];
} else {