Skip to content

Instantly share code, notes, and snippets.

View nidin's full-sized avatar
🍎
I may be slow to respond.

Nidin Vinayakan nidin

🍎
I may be slow to respond.
View GitHub Profile
@nidin
nidin / Dockerfile
Last active July 20, 2016 15:07
Mount Ubuntu Host Docker to Official Jenkins Container
FROM jenkins
USER root
RUN apt-get update \
&& apt-get install -y sudo apt-transport-https ca-certificates \
&& rm -rf /var/lib/apt/lists/*
RUN echo "www-data ALL=NOPASSWD: ALL" >> /etc/sudoers
RUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
RUN echo "deb https://apt.dockerproject.org/repo debian-jessie main" > /etc/apt/sources.list.d/docker.list
RUN apt-get update
@nidin
nidin / async-await-test.js
Created June 8, 2017 08:38
JavaScript Async Await Sequential and Parallel Test
async function testSequential() {
async function f1 (){
let promise = new Promise((resolve, reject) => {
setTimeout(()=>{resolve(2)}, 2000);
});
return promise;
}
async function f2 (){
let promise = new Promise((resolve, reject) => {
setTimeout(()=>{resolve(2)}, 2000);
$.ajax({url: "https://url", success: function(result){
console.log(result);
$("#div1").html(result);
}});
@nidin
nidin / spec.ts
Last active October 23, 2019 09:42
describe("When passing an unknown element type", () => {
it("Should throw error", () => {
const type = "unknown-type";
const array = [1];
expect(() => {
$sort([array, 0, <any>type]);
}).toThrowError(`Unknown array element type:${type}`);
});
});