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
%{ | |
var indexed = []; | |
function log() { | |
console.log.apply(console, arguments); | |
} | |
function index(k, q) { | |
var i = k.indexOf(q); | |
if (i >= 0) { | |
if (typeof(k) === 'string') | |
indexed.push({ value: q, start: i, end: i + q.length }); |
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
/* lexical grammar */ | |
%lex | |
%options case-insensitive | |
%% | |
\s+ /* skip whitespace */ | |
\'[^']+\' return 'SQTERM' | |
\"[^"]+\" return 'DQTERM' | |
"and" return 'AND' | |
"or" return 'OR' |
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
%{ | |
Date.prototype.get_floor = function() { | |
return this.low_resolution | |
? new Date(this.getYear() + 1900, this.getMonth(), this.getDate()) | |
: this; | |
} | |
Date.prototype.get_ceiling = function() { | |
return this.low_resolution | |
? new Date(this.getYear() + 1900, this.getMonth(), this.getDate(), 23, 59, 59, 999) | |
: this; |
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
// 1. get browser | |
// 2. patch js | |
// 3. ??? | |
// 4. profit | |
navigator.sayswho = (function(){ | |
var ua = navigator.userAgent, tem, M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || []; | |
if(/trident/i.test(M[1])){ | |
tem= /\brv[ :]+(\d+)/g.exec(ua) || []; | |
return 'IE '+(tem[1] || ''); |
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
var Slots = (function(options) { | |
this.mode = 'x'; | |
this.max = options.width; | |
if (options.height) { | |
this.mode = 'y'; | |
this.max = options.height; | |
} | |
this.grid = 0; | |
this.items = []; |
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
var Slots = require('./slots.js'); | |
exports.slotsTests = { | |
irregularShapeDoesNotThrowWhenRotated: (test) => { | |
test.expect(2); | |
var s_h = new Slots({width:3}); | |
var s_v = new Slots({height:3}); |
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
using System; | |
using System.Collections.Generic; | |
using System.Configuration; | |
using System.IO; | |
using System.IO.Compression; | |
using System.Linq; | |
using System.Net; | |
using System.Text; | |
using System.Text.RegularExpressions; | |
using System.Threading.Tasks; |
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
void Main() | |
{ | |
var file = @"someproject.csproj"; | |
var dir = System.IO.Path.GetDirectoryName(file); | |
var proj = XDocument.Load(file); | |
var files = proj.Descendants().Where(p => p.Name.LocalName == "Content" && p.Attributes().Any(a => a.Name.LocalName == "Include")); | |
var toRemove = new List<XElement>(); |
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
// get a function's parameters as [...string] | |
(function() { | |
if (Function.prototype.parameters) | |
return; | |
Object.defineProperty(Function.prototype, "parameters", { get: function() { | |
var pattern = /^(?:(?:(?:function\s+[\w_\$][\w\d_\$]*)|function\s*|[\w_\$][\w\d_\$]*)(?:\(|[\w_\$])|\(|)(\s*(([\w_\$][\w\d_\$]*)([,\s]*)?)*)/gim | |
var matches = pattern.exec(this.toString()) | |
return matches[1].split(',').map(s => s.trim()).filter(s => s.length) | |
}}) | |
})() |
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
[2018-01-07 12:30:04.731133]: Node starting, version: 9.0 | |
[2018-01-07 12:30:04.732634]: Work pool running 4 threads | |
[2018-01-07 12:30:04.734634]: Starting bootstrap attempt | |
[2018-01-07 12:30:04.735134]: Bootstrap stopped because there are no peers | |
[2018-01-07 12:30:04.735134]: Exiting bootstrap attempt | |
[2018-01-07 12:30:12.761601]: UPnP local address: , discovery: 0, IGD search: 3 | |
[2018-01-07 12:30:12.762104]: UPnP device url: http://192.168.1.1:1990/d4311ffc-9c6f-4028-89f7-c49bd6e7e090/WFADevice.xml st: upnp:rootdevice usn: uuid:abebceb4-eb14-2a04-c1c4-bc92c91503fb::upnp:rootdevice | |
[2018-01-07 12:30:12.769102]: UPnP TCP mapping verification response: -1, external ip response: -1, external ip: , internal ip: 0.0.0.0, remaining lease: | |
[2018-01-07 12:30:12.777111]: UPnP UDP mapping verification response: -1, external ip response: -1, external ip: , internal ip: 0.0.0.0, remaining lease: | |
[2018-01-07 12:30:12.780110]: UPnP TCP port mapping response: -4, actual external port |
OlderNewer