Skip to content

Instantly share code, notes, and snippets.

View oJshua's full-sized avatar

Josh oJshua

  • Las Cruces, NM
View GitHub Profile
@oJshua
oJshua / iso8601date.jl
Created October 20, 2019 05:08
Parse ISO8601 date string with 'Z' for UTC in Julia
using Dates
escaped_format = "yyyy-mm-dd\\THH:MM:SS.sss\\Z"
Zulu = String
Dates.CONVERSION_SPECIFIERS['Z'] = Zulu
Dates.CONVERSION_DEFAULTS[Zulu] = ""
df = Dates.DateFormat(escaped_format)
function convert_date(datestring::String)
Dates.parse(DateTime, datestring, df)
gyp ERR! System Linux 4.9.49-moby
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /app/node_modules/posix
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm verb lifecycle posix@4.1.1~install: unsafe-perm in lifecycle false
npm verb lifecycle posix@4.1.1~install: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/app/node_modules/posix/node_modules/.bin:/app/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
npm verb lifecycle posix@4.1.1~install: CWD: /app/node_modules/posix
npm info lifecycle posix@4.1.1~install: Failed to exec install script
@oJshua
oJshua / blacklist.txt
Created October 25, 2016 21:25
Manage iptables whitelist and blacklist shell script
<your blacklisted IPs>
@oJshua
oJshua / client.js
Last active October 25, 2016 20:26
How To Connect Dnode with Socket IO in 2016
var io = require('socket.io');
var dnode = require('dnode');
var socket = io.connect();
var stream = new Stream();
stream.writeable = true;
stream.readable = true;
stream.write = function(buffer) {
socket.emit('message', String(buffer));
@oJshua
oJshua / linker.js
Last active October 25, 2016 06:43
Quill JS Link Module
var Quill = require('quill');
var Delta = require('quill-delta');
var linkRegex = /((([A-Za-z]{3,9}:(?:\/\/)?)(?:[\-;:&=\+\$,\w]+@)?[A-Za-z0-9\.\-]+|(?:www\.|[\-;:&=\+\$,\w]+@)[A-Za-z0-9\.\-]+)((?:\/[\+~%\/\.\w\-_]*)?\??(?:[\-\+=&;%@\.\w_]*)#?(?:[\.\!\/\\\w]*))?)/;
function addhttp(url) {
if (!/^(f|ht)tps?:\/\//i.test(url)) {
url = "http://" + url;
}
return url;