lol, only Canada is sane xD
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
ohnobinki@gibby /tmp/.private/ohnobinki/testx $ LC_ALL=C ls -la | |
total 14636 | |
drwxr-xr-x 2 ohnobinki users 120 Jun 11 20:37 . | |
drwx-----T 16 ohnobinki users 440 Jun 11 20:17 .. | |
-rw-r--r-- 1 ohnobinki users 3069158 Jun 11 20:17 IMG_20180327_165234.jpg | |
-rw-r--r-- 1 ohnobinki users 2939105 Jun 11 20:37 x.7z | |
-rw-r--r-- 1 ohnobinki users 5900455 Jun 11 20:18 x.tar.gz | |
-rw-r--r-- 1 ohnobinki users 3069158 Jun 11 20:17 x2.jpg |
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
#!/bin/sh | |
# The find ignores any VS build folders and minified files. It | |
# then grabs any *.js and passes them to xargs. | |
# | |
# The xargs runs a script per each file which is unfortunately inside | |
# of "" so everything has to be escaped, making the inside unreadable. | |
# The sed takes any line ending in opening square bracket ‘[’, comma ‘,’, | |
# space ‘ ’ and removes the newline. It took me a long time to figure out | |
# how to get sed to join lines together. It involves some ridiculousness |
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
module.exports = function (fileInfo, { | |
jscodeshift, | |
}, options) { | |
// Work around for https://github.com/facebook/jscodeshift/issues/262 | |
const isUnix = fileInfo.source.indexOf('\r\n') === -1; | |
const dom = jscodeshift(fileInfo.source); | |
const topLevelStatements = jscodeshift(dom.get('program', 'body').value).filter(path => { | |
return jscodeshift.Statement.check(path.node); | |
}); | |
// Don’t add another one if it is already there. |
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
csharp> 0x80000000.GetType() | |
System.UInt32 | |
csharp> 0x40000000.GetType() | |
System.Int32 |
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
#include <windows.h> | |
int main( | |
int argc, | |
const char *const argv[]) { | |
const HANDLE stdOutput = GetStdHandle(STD_OUTPUT_HANDLE); | |
if (stdOutput == INVALID_HANDLE_VALUE) { | |
return 1; | |
} | |
const LPSTR cmdLine = GetCommandLine(); | |
if (!WriteFile(stdOutput, cmdLine, lstrlenA(cmdLine), NULL, NULL)) { |
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
ohnobinki@gibby ~/downloads $ gcc -Wall -o opennofollow opennofollow.c | |
ohnobinki@gibby ~/downloads $ touch x.txt | |
ohnobinki@gibby ~/downloads $ ln -s x.txt y.txt | |
ohnobinki@gibby ~/downloads $ ./opennofollow | |
-1 | |
ohnobinki@gibby ~/downloads $ cat y.txt | |
ohnobinki@gibby ~/downloads $ rm y.txt | |
ohnobinki@gibby ~/downloads $ touch y.txt | |
ohnobinki@gibby ~/downloads $ ./opennofollow | |
3 |
initial tweet of luceleaftea: https://twitter.com/luceleaftea/status/946938980574089216 followup: https://twitter.com/ohnobinki/status/946944544528007168
Ran them all to see which ones are faster. Some of them have values that are too close to tell if they are actually better or just flucuations in the environment.
ohnobinki@gibby ~/downloads $ for x in $(seq 0 4); do echo -n "doStuff(${x}) "; python3 -m timeit -s 'from blahstar import doStuff' "doStuff(${x})"; done
doStuff(0) 10 loops, best of 3: 211 msec per loop
doStuff(1) 10 loops, best of 3: 179 msec per loop
doStuff(2) 10 loops, best of 3: 179 msec per loop
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
#!/usr/bin/env node | |
const axios = require('axios'); | |
const FormData = require('form-data'); | |
const fs = require('fs'); | |
const filePath = __dirname + '/../accept-http-post-file/cookie.jpg'; | |
fs.readFile(filePath, (err, imageData) => { | |
if (err) { | |
throw err; | |
} |