Skip to content

Instantly share code, notes, and snippets.

@n1ghtmare
n1ghtmare / 1-before.lua
Last active November 22, 2022 19:29
Testing colorbuddy
local Color, colors, Group, groups, styles = require('colorbuddy').setup()
local M = {}
function M.setup(opts)
opts = opts or {}
if opts.primary then
Color.new('primary', opts.primary)
else
@n1ghtmare
n1ghtmare / UnionFind.swift
Last active August 29, 2015 14:03
UnionFind in Swift
class UnionFind {
var id:Int[];
var count:Int;
init(N:Int) {
count = N;
id = [];
for(var i = 0; i < N; i++) {
id.append(i);
}
@n1ghtmare
n1ghtmare / countdown.js
Last active December 27, 2015 13:29
moment.js countdown prototype
var countdown = function(end) {
var start = moment();
var d = end.diff(start);
var dur = moment.duration(d);
var days = dur.days();
var hours = dur.hours();
var minutes = dur.minutes();
var seconds = dur.seconds();
$("#countdown").html(days + " days " + hours + " hours " + minutes + " minutes " + seconds + " seconds ");