Skip to content

Instantly share code, notes, and snippets.

View koush's full-sized avatar

Koushik Dutta koush

View GitHub Profile
JS_BOOL JS_IsArrayBuffer(JSValueConst v)
{
JSObject *p;
if (JS_VALUE_GET_TAG(v) != JS_TAG_OBJECT)
return FALSE;
p = JS_VALUE_GET_OBJ(v);
if (p->class_id != JS_CLASS_ARRAY_BUFFER &&
p->class_id != JS_CLASS_SHARED_ARRAY_BUFFER) {
return FALSE;
}
@koush
koush / du.txt
Last active October 5, 2019 18:25
Mac:work$ du -h node_modules/kotlin/
4.0K node_modules/kotlin//kotlin/org/w3c/css/masking
4.0K node_modules/kotlin//kotlin/org/w3c/css
4.0K node_modules/kotlin//kotlin/org/w3c/xhr
4.0K node_modules/kotlin//kotlin/org/w3c/fetch
4.0K node_modules/kotlin//kotlin/org/w3c/files
16K node_modules/kotlin//kotlin/org/w3c/dom/svg
12K node_modules/kotlin//kotlin/org/w3c/dom/css
4.0K node_modules/kotlin//kotlin/org/w3c/dom/url
4.0K node_modules/kotlin//kotlin/org/w3c/dom/pointerevents
require('http').createServer(
(req, res) => require('child_process').spawn('/usr/local/bin/ffmpeg', [
'-i',
'rtsp://192.168.2.11:7447/fXbuD6HqIV9y8BKL',
'-vcodec',
'copy',
'-f',
'mpegts',
'pipe:1',
]).stdout.pipe(res)
let currentTypes = null;
function wrapWithTypes (types, fn) {
return function (...args) {
const oldTypes = currentTypes;
currentTypes = types;
try {
return fn.apply(this, args);
} finally {
currentTypes = oldTypes;
let currentTypes = null;
function wrapWithTypes (types, fn) {
return function (...args) {
const oldTypes = currentTypes;
currentTypes = types;
try {
return fn.apply(this, args);
} finally {
currentTypes = oldTypes;
@koush
koush / smbios.plist
Created April 17, 2017 21:07
Don't check this file in
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SMBIOS</key>
<dict>
<key>ProductName</key>
<string>MacPro6,1</string>
<key>SerialNumber</key>
<string>CUSTOM SERIAL NUMBER</string>
<jcase> koush_, ping
<koush_> jcase: yeah so
<koush_> RM has ~2million users
<koush_> RM starts up once a day
<koush_> to check for updates and stuff
<koush_> i put the PayPal.init in Application.onCreate
<koush_> like their example
<koush_> apparently, their new API, which i upgraded to a few weeks ago, put a network call in their PayPal.init
<koush_> so, every hour on the top of the hour
<koush_> thousands and thousands of clients were hitting their servers
{
"name": "Vysor",
"version": "1.3.1",
"main": "electron-main.js",
"description": "A window to your Android",
"scripts": {
"start": "electron .",
"package": "node package.js"
},
"dependencies": {
var resultPromise = electronInstaller.createWindowsInstaller({
appDirectory: appPath,
outputDirectory: appPath + '-installer',
authors: manifest.author || manifest.name,
version: manifest.version,
exe: manifest.name + '.exe',
setupExe: path.basename(appPath) + '.exe',
productName: manifest.name,
title: manifest.name,
Mac-Pro:Gradle$ gradle clean --stacktrace
FAILURE: Build failed with an exception.
* Where:
Build file '/Volumes/Android/Gradle/ClockworkModBilling/build.gradle' line: 1
* What went wrong:
A problem occurred evaluating project ':ClockworkModBilling'.
> Failed to apply plugin [id 'com.android.library']