This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# | |
# Created by Vegard Hanssen <Vegard.Hanssen@menneske.no> | |
# 2016-12-03 | |
# | |
# The script will move the files recursive from one directory to another | |
# For each $sleepcount it will sleep for $sleepmin min so google drive | |
# can finish the syncjob | |
use File::Copy::Recursive qw(fmove); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var text = 'Little brown="and yellow" fox=1 jumps over=lazy dog'; | |
var res = text.match(/([^=\s]+="[^"]+")|\S+/g).map(function (p) { | |
return p.match(/^([^=\s]*)(?:="?([^"]*)"?)?$/).splice(1, 2); | |
}) | |
console.log(res); | |
// Output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _ = require('underscore'); | |
var async = require('async'); | |
var sumTime = {}; | |
var sortarray = []; | |
var ARRAYCOUNT = 100000; | |
var INNERITERATIONS = 10; | |
var OUTERITERATIONS = 5; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Small class for getting Easter Sunday at a specific year | |
*/ | |
public class Easter { | |
public static Calendar get(int year) { | |
int y = year; | |
int a = y % 19; | |
int b = y / 100; | |
int c = y % 100; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# | |
# Solution to the Vietnamese pesky snake in perl :) | |
# Calculates all 128 solutions | |
# http://www.theguardian.com/science/alexs-adventures-in-numberland/2015/may/21/how-to-solve-the-maths-puzzle-for-vietnamese-eight-year-olds-that-stumped-parents-and-teachers | |
# | |
# function: a+(13*b/c) + d + (12*e) - f - 11 + (g*h/i)-10; | |
# Setup the numbers to insert | |
@a = qw(1 2 3 4 5 6 7 8 9); |