Skip to content

Instantly share code, notes, and snippets.

View gist:fb9521be908297d852d5
.then(function (element) {"=> found somethining..");; // this wrong since we are not returning and the chain goes goes on
// better?
.click().then(function(){"=> found somethining..")})
denov / gist:5c2b858f9a28343a5424
Created Sep 25, 2014
trying to test dijit dropdown
View gist:5c2b858f9a28343a5424
.then(function(id){"=> found section ID : " + id);
.then(function(menu){"=> Found option menu ");;
denov /
Created Nov 27, 2017
Update SSH ingest rule
import boto3
from urllib2 import urlopen
sg_id = "sg-xxxxxxxx"
sg_desc = "user-name"
old_ip = ""
current_ip = urlopen("").read()
denov / uuidv4.ts
Created Oct 26, 2018
typescript function for uuid v4
View uuidv4.ts
export function uuidv4(): string {
return (`${1e7}-${1e3}-${4e3}-${8e3}-${1e11}`).replace(/[018]/g, (c: any) =>
(c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)
denov / themeContext.ts
Created Apr 30, 2019
dojo2 theme injector
View themeContext.ts
import {themeContext} from "./main";
import darkStyle from "./themes/dark";
import lightStyle from "./themes/light";
import defaultStyle from "./themes/default";
import * as defaultColors from "./themes/default/app.m.css";
import * as darkColors from "./themes/dark/app.m.css";
import * as lightColors from "./themes/light/app.m.css";
View Single item from stream
import java.util.List;
import java.util.function.Function;
public class StreamUtils {
public static <T> Collector<T, ?, T> singletonCollector() {
View Cache Config Sample
package org.magic.config;
import org.magic.config.annotation.Aws;
import org.magic.config.annotation.LocalDev;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cache.concurrent.ConcurrentMapCache;