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
using System; | |
namespace Utils { | |
public static class TimeSpanExtensions | |
{ | |
public static TimeSpan Round(this TimeSpan span, TimeSpanRoundingType type, MidpointRounding mode = MidpointRounding.ToEven) => | |
type switch | |
{ | |
TimeSpanRoundingType.QuarterMinute => TimeSpan.FromSeconds(Math.Round(span.TotalSeconds / 15, 0, mode) * 15), |
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
--- albert/no-virtualbox.patch 1969-12-31 19:00:00.000000000 -0500 | |
+++ albert-patched/no-virtualbox.patch 2017-09-29 08:53:13.278139849 -0400 | |
@@ -0,0 +1,10 @@ | |
+--- CMakeLists.txt 2017-09-29 08:52:01.594975848 -0400 | |
++++ CMakeLists.txt.patched 2017-09-29 08:52:32.801569554 -0400 | |
+@@ -22,7 +22,6 @@ | |
+ add_subdirectory(ssh) | |
+ add_subdirectory(system) | |
+ add_subdirectory(terminal) | |
+-add_subdirectory(virtualbox) |
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
const Benchmark = require('benchmark'); | |
const {PassThrough} = require("stream"); | |
const createStreamBeans = require("streambeans").createStreamBeans; | |
const suite = new Benchmark.Suite(); | |
const inStreamBeans = new PassThrough(); | |
const outStreamBeans = new PassThrough(); | |
const inStreamNoBeans = new PassThrough(); |
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
_borg() { | |
local curcontext="$curcontext" state line | |
typeset -A opt_args | |
_arguments -C \ | |
{-h,--help}'[Show Help]'\ | |
{-v,--version}'[Show Version]'\ | |
':command:->command'\ | |
'*::options:->options' |
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
// ==UserScript== | |
// @name New Coffee-Userscript | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description shows how to use coffeescript compiler | |
// @author You | |
// @require http://coffeescript.org/extras/coffee-script.js | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js | |
// @match https://speed.cd/browse.php* | |
// ==/UserScript== |
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 Promise = require("bluebird"); | |
function doSomething() | |
{ | |
return Promise | |
.try(function () | |
{ | |
return task1(); | |
}) | |
.then(function (result) |
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
-- TurbineMonitor | |
-- Made By: MrKMG <mrkmg.com> | |
-- | |
-- This program will keep your turbines up to speed and turn | |
-- the coil on and off as needed. | |
-- | |
-- To Use: | |
-- | |
-- Attach as many Turbines and Monitors as you would like via | |
-- wired modems. Monitors will all display the same information |
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
<?php | |
// Adds @asset tag to blade templates; | |
// USAGE: @asset('path/to/file.css|js') | |
Blade::extend(function($view, \Illuminate\View\Compilers\BladeCompiler $compiler) | |
{ | |
$pattern = $compiler->createMatcher('asset'); | |
return preg_replace($pattern, '<?php Assets::add$2; ?>', $view); | |
}); |
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
//** Webworker.js | |
// Assuming we have an array of arrays, each containing an RGB value. | |
var colormap = [[255,255,0],[24,50,25],...,[45,64,25],[0,255,0]]; | |
// First create a variable of a transferrable datatype | |
var bytes= new Uint8Array(pond.total*4); | |
// Loop through the array and set the colors | |
for(var i=0;i<colormap.length;i++){ |
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
<?php | |
proc_nice(19); //Lowers niceness | |
set_time_limit(0); //Removes timelimit of script | |
/**** | |
... | |
Do some very intensive task you do not want to bog down your server | |
... | |
****/ |
NewerOlder