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
.aggregate([ | |
{ | |
$lookup: { | |
from: 'snapshots', | |
let: { address: '$address' }, | |
pipeline: [ | |
{ | |
$match: { | |
$expr: { | |
$and: [ |
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 path = require('path'); | |
const webpack = require('webpack'); | |
const CopyWebpackPlugin = require('copy-webpack-plugin'); | |
const MiniCssExtractPlugin = require("mini-css-extract-plugin"); | |
const mode = process.env.NODE_ENV || 'production'; | |
const devtool = mode === 'development' ? 'cheap-module-source-map' : 'source-map'; | |
const serverBuild = { | |
mode, |
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 Colorful Teg | |
// @version 1.0 | |
// @match *teg.avature.net* | |
// @run-at document-end | |
// ==/UserScript== | |
[ | |
'.analysis_functional > td {background-color: rgba(255, 80, 168, 0.45) !important; }', | |
'.testing > td { background-color: rgba(255, 255, 176, 0.45) !important; }', |
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
<? | |
$db = DB::getConnection(); | |
$sql = "SELECT * FROM Projects ORDER BY name"; | |
$data = $db->query($sql)->fetchAll(); | |
array_walk($data, function(&$v) { | |
$v['enabled'] = (int)$v['enabled']; | |
$v['visible'] = (int)$v['visible']; | |
}); | |
Response::json($data); | |
?> |
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
function numberFormat(number, dec, dsep, tsep) { | |
if (isNaN(number)) return ""; | |
number = number.toFixed(dec || 0); | |
var pindex = number.indexOf('.'), fnums, decimals, parts = []; | |
if (pindex > -1) { | |
fnums = number.substring(0, pindex).split(''); | |
decimals = (dsep || '.') + number.substr(pindex+1); | |
} | |
else { | |
fnums = number.split(''); |
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
/** | |
* Create HTML anchor tags replacing URL's | |
* | |
* @param string $input | |
* @param string $target anchor target attribute | |
* @return string | |
*/ | |
function parseLinks($input, $target = '_blank') { | |
return preg_replace('#(^|\s)((?:http|https|ftp)://.+?\.[a-z]{2,3}.*?)(\s|$)#i', '$1<a href="$2" target="' . $target . '">$2</a>$3', $input); | |
} |
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 httpProxy = require('http-proxy'), | |
http = require('http'); | |
var options = { | |
router: { | |
'.*?\.demian.magic.com': '127.0.0.1:8000' | |
} | |
}; | |
var proxyServer = httpProxy.createServer(options); | |
proxyServer.listen(80); |
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 util = require('util'), | |
fs = require('fs'); | |
// textos... | |
var txta = fs.readFileSync('a.txt', 'utf8'); | |
var txtb = fs.readFileSync('b.txt', 'utf8'); | |
var words = txtb.trim().split(/\s+/); | |
var uniq = []; | |
words.forEach(function(w) { |
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 util = require('util'), | |
http = require('http'), | |
connect = require('connect'), | |
express = require('express'); | |
var app = express.createServer(); | |
app.configure(function(){ | |
app.use(express.bodyParser()); | |
app.use(express.errorHandler({ dumpExceptions: true, showStack: true })); |
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
process.env.TZ = 'UTC'; | |
var util = require('util'), | |
fs = require('fs'), | |
request = require('request'), | |
args = require('argsparser').parse(); | |
for (var count = 0; count < 10; count++) { | |
(function(i) { | |
var uri = 'http://www.google.com/?i=' + i; |
NewerOlder