This file contains hidden or 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
// npm i benchmark microtime | |
// | |
// https://jsben.ch/QlNfk | |
const suite = new (require("benchmark").Suite)(); | |
const limit = 1000; | |
suite | |
.add("reverse", function () { | |
const arr = []; | |
for (var i = 0; i <= limit; i++) { |
This file contains hidden or 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
[...document.querySelectorAll(".token_unit").entries()].map(e => e[1].innerText).map(e => { | |
if(!e.trim()) { | |
return " "; | |
} | |
return e; | |
}).join(""); |
This file contains hidden or 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
choco list -lo -r -y | % { $_.Split('|') | select -First 1 } | % { "choco install " + $_ + " -y" } |
This file contains hidden or 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
function convertToRoman(num) { | |
var first = ""; | |
var second = ""; | |
var third = ""; | |
var count = ""; | |
var placeHolder = ""; | |
var addFirst = ""; | |
var addSecond = ""; | |
var answer = ""; | |
var test = ""; |
This file contains hidden or 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
Header always set Access-Control-Allow-Origin "*" | |
Header always set Access-Control-Allow-Methods "POST, GET, PUT, OPTIONS, PATCH, DELETE" | |
Header always set Access-Control-Allow-Headers "X-Accept-Charset,X-Accept,Content-Type" | |
RewriteEngine On | |
RewriteCond %{REQUEST_METHOD} OPTIONS | |
RewriteRule ^(.*)$ $1 [R=200,L,E=HTTP_ORIGIN:%{HTTP:ORIGIN}]] |
This file contains hidden or 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or 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 | |
/** | |
* @author Federico Liva <[email protected]> | |
* @copyright Copyright (C)2015 Federico Liva. All rights reserved. | |
* @license GNU General Public License, version 2 or later | |
*/ | |
error_reporting(E_ALL); | |
ini_set('display_errors', 1); | |
ini_set('max_execution_time', 0); |
This file contains hidden or 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
// http://jsbin.com/vivucuceco/edit?output | |
var csv = '', | |
link, | |
div; | |
jQuery("#thePlaylist tr").each(function(i,e){ | |
if (i > 0) { | |
var as = jQuery("a", jQuery("td", e)[2]).each(function(j, el){ | |
csv = csv + '"'+ el.innerHTML + '";"' + el.href + '"'; | |
if (j === 0) { | |
csv = csv + ';'; |
This file contains hidden or 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
################################################################################# | |
### The perfect Varnish configuration for Joomla (& other CMS based) websites ### | |
################################################################################# | |
# USE: Place the contents of this configuration inside the main | |
# Varnish configuration file, located in: /etc/varnish/default.vcl (root server access required - obviously) | |
# IMPORTANT: The following setup assumes a 2 minute cache time. You can safely increase | |
# this to 5 mins for less busier sites or drop it to 1 min or even 30s for high traffic sites. |
This file contains hidden or 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
" .vimrc of Bart Trojanowski | |
" | |
" You can get a more upto date version from | |
" http://www.jukie.net/~bart/conf/vimrc | |
" | |
" Most files sourced by this vimrc are located here: | |
" http://www.jukie.net/~bart/conf/vim/ | |
" | |
" --------------------------------------------------------------------------- |
NewerOlder