Skip to content

Instantly share code, notes, and snippets.

@abiank
abiank / test2.js
Created March 10, 2023 18:05
// instrument all functions in a file with a call log
function transformAST(IN) {
// read the filename
const fs = require('fs');
const filename = fs.readFileSync(IN, 'utf8');
// transform the file into an AST
const esprima = require('esprima');
const ast = esprima.parseScript(filename);
@abiank
abiank / bindings.json
Created May 1, 2022 15:22
nanolike Micro bindings
{
"Alt-/": "lua:comment.comment",
"CtrlUnderscore": "lua:comment.comment",
"Ctrl-k": "CutLine",
"Ctrl-u": "Paste",
"Ctrl-o": "Save",
"Ctrl-w": "Find"
}
@abiank
abiank / createIndexFiles.sh
Created November 14, 2016 22:51 — forked from tsulej/createIndexFiles.sh
Bash scripts for preparing images for deep neural network training
#!/bin/bash
# script creates train.txt and val.txt prepared by processImages.sh script
# it assumes that all images are processed and there are 10 images minimum in each category
results_folder="images"
rm train.txt
rm val.txt
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
#EventID|Time|Latitude|Longitude|Depth/Km|Author|Catalog|Contributor|ContributorID|MagType|Magnitude|MagAuthor|EventLocationName
6427091|2016-02-07T01:41:59.140000|36.9942|14.861|4.6|BULLETIN-INGV||||Mw|3.3|--|Siracusa
6427151|2016-02-07T01:44:53.880000|36.989|14.8402|7.4|BULLETIN-INGV||||ML|2.2|--|Ragusa
6427181|2016-02-07T01:47:38.510000|36.9802|14.8452|8.0|BULLETIN-INGV||||ML|2.2|--|Ragusa
6427261|2016-02-07T03:31:04.020000|37.9293|14.5313|9.6|BULLETIN-INGV||||ML|2.3|--|Messina
6428821|2016-02-07T18:17:26.890000|43.4337|12.5268|9.0|BULLETIN-INGV||||ML|2.2|--|Perugia
6429141|2016-02-07T22:20:12.860000|38.2495|15.8695|14.0|BULLETIN-INGV||||ML|2.5|--|Reggio di Calabria
6429311|2016-02-08T03:47:22.380000|42.8817|12.7327|5.2|BULLETIN-INGV||||ML|2.0|--|Perugia
6450711|2016-02-08T06:31:15.790000|44.8383|11.5378|10.2|BULLETIN-INGV||||Md|2.1|--|Ferrara
6429951|2016-02-08T11:23:55.850000|43.9877|11.8983|29.1|BULLETIN-INGV||||ML|2.7|--|Forli'-Cesena
/// getAudioPlayer()._currentPlaylist._ref._list
//// merge this:
str.replace(/[^\x00-\x7F]/g, "");
////
@abiank
abiank / known working vers.txt
Created July 7, 2016 20:56
known working vers
ethercalc@0.2014.1 /home/pi/neatsheet
├── ejs@2.4.2
├─┬ execSync@1.0.2
│ └─┬ temp@0.5.1
│ └─┬ rimraf@2.1.4
│ └── graceful-fs@1.2.3
├── UNMET DEPENDENCY hiredis@0.1.x
├── http-sync@0.0.4
├─┬ optimist@0.6.1
│ ├── minimist@0.0.10
@abiank
abiank / cutter.lua
Last active June 22, 2016 14:14
vlc ext
--[[
INSTALLATION (create directories if they don't exist):
- put the file in the VLC subdir /lua/extensions, by default:
* Windows (all users): %ProgramFiles%\VideoLAN\VLC\lua\extensions\
* Windows (current user): %APPDATA%\VLC\lua\extensions\
* Linux (all users): /usr/share/vlc/lua/extensions/
* Linux (current user): ~/.local/share/vlc/lua/extensions/
* Mac OS X (all users): /Applications/VLC.app/Contents/MacOS/share/lua/extensions/
- Restart VLC.
]]--
app: live/rainews_nogeo@44311?auth=daEbmanbOclavbpbmdhcXb3aTaUcKdacbct-bu_l6S-c0-CjuvrGo&aifp=V001
flashVer: LNX 14,0,0,145
swfUrl: http://www.rai.tv/dl/player/Fallback/flashmediaelement.swf
tcUrl: rtmp://cp113192.live.edgefcs.net/live/rainews_nogeo@44311?auth=daEbmanbOclavbpbmdhcXb3aTaUcKdacbct-bu_l6S-c0-CjuvrGo&aifp=V001
pageUrl: http://www.rai.tv/dl/RaiTV/dirette/PublishingBlock-233b8482-1cbc-4970-87d5-9d7604b26ddb.html?channel=RaiNews
Playpath: rainews_nogeo@44311?auth=daEbmanbOclavbpbmdhcXb3aTaUcKdacbct-bu_l6S-c0-CjuvrGo&aifp=V001
ERROR: Request timeout/select failed, ignoring request
Closing connection... done!
@abiank
abiank / formula1_extract.js
Created September 5, 2014 09:10
formula1.js modifications to make use of formula.js formulas in ethercalc
// prerequisite: browserify formula.js and load it
SocialCalc.Formula.CalculateFunction = function(fname, operand, sheet) {
var fobj, foperand, ffunc, argnum, ttext,args,elem;
var scf = SocialCalc.Formula;
var ok = 1;
var errortext = "";
fobj = scf.FunctionList[fname];
if (fobj) {
@abiank
abiank / exportdb.js
Last active August 29, 2015 14:04 — forked from toots/gist:5136523
export db
// Generated by CoffeeScript 1.6.3
(function() {
var exportDb;
exportDb = function(name, cb) {
var handler;
handler = indexedDB.open(name);
handler.onsuccess = function(sender) {
var db, results, stores, transaction;
db = sender.target.result;