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 | |
/* | |
* Outputs a color (#000000) based Text input | |
* | |
* @param $text String of text | |
* @param $min_brightness Integer between 0 and 100 | |
* @param $spec Integer between 2-10, determines how unique each color will be | |
*/ | |
function genColorCodeFromText($text,$min_brightness=100,$spec=10) |
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
$types = array( | |
'ai' => 'application/postscript', | |
'aif' => 'audio/x-aiff', | |
'aifc' => 'audio/x-aiff', | |
'aiff' => 'audio/x-aiff', | |
'asc' => 'text/plain', | |
'atom' => 'application/atom+xml', | |
'atom' => 'application/atom+xml', | |
'au' => 'audio/basic', | |
'avi' => 'video/x-msvideo', |
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
--- 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
<?php | |
// Code snippet to extract the icon from an exe file on a Linux system -- tested on Debian Wheezy | |
// Install icoutils on your system e.g. sudo apt-get install icoutils | |
// Web process must have write privileges to /tmp | |
///** Config **/// | |
$input_file = '/path/to/program.exe'; |
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 | |
... | |
****/ |
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== |
NewerOlder