Skip to content

Instantly share code, notes, and snippets.

Noitidart Noitidart

Block or report user

Report or block Noitidart

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

Alright then, lets start with copy array a into b, by reusing and modifying memset.

function memcpy(dst, src, size) {
  for (var i = 0; i < size; ++i) {
    dst[i] = src[i];

Now, thats nice, but does not actually make sure that the arrays have the same CType, better add a check for that.

View ctypes
View set-icon.js
var x11 = require('x11');
var PNG = require('png-js');
var bl = require('bl');
require('child_process').exec('locate png | grep 48').stdout.pipe(bl(function(err, files) {
var pngNames = files.toString().split('\n');
var pngIndex = 0;
x11.createClient(function(err, display) {
alex-spataru / Opening files using system events in Qt
Last active Aug 29, 2015
Open files from system request on Mac [Qt]
View Opening files using system events in Qt
#include <QEvent>
#include <QApplication>
// Create a subclass of QApplication so that we can customize what we
// do when the operating system sends us an event (such as opening a file)
class MyApp : public QApplication
Noitidart / _ff-addon-snippet-X11_XGetWindowProperty.js
Last active Aug 29, 2015
_ff-addon-snippet-X11_XGetWindowProperty - Shows how to use XGetWindowProperty, this is my skeleton for when I use it. [jsctypes] [x11] [unix]
View _ff-addon-snippet-X11_XGetWindowProperty.js
var nixtypesInit = function() {
// BASIC TYPES (ones that arent equal to something predefined by me)
this.ATOM = ctypes.unsigned_long;
this.BOOL =;
this.CHAR = ctypes.char;
this.GDKDRAWABLE = ctypes.StructType('GdkDrawable');
this.GDKWINDOW = ctypes.StructType('GdkWindow');
this.DATA = ctypes.voidptr_t;
Yoric / gist:c710b97dd55f98f8f0e3
Created Apr 20, 2015
Making a PromiseWorker that can shutdown
View gist:c710b97dd55f98f8f0e3
let myWorker = {
// Worker initialization
get worker() {
if (this._worker) {
return this._worker;
// Otherwise, initialize PromiseWorker.
luckyrat / gist:7803415810fb4c09c975
Created May 22, 2015
importGlobalProperties test JSM
View gist:7803415810fb4c09c975
// JSM for working out which globalproperties can be imported in a specific Firefox version.
// I'm not certain availability always equates to functionality but it probably does
// and in any case it's a way to narrow down the more involved test for functionality of each property
// Run from browser toolbox scratchpad like:
// Components.utils.import("resource://test-importGlobalProperties-addon/test.jsm");
kewisch / TracedRequest.js
Created Oct 2, 2014
Monitor all http(s) network requests using the Mozilla Platform
View TracedRequest.js
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at */
var allRequests = [];
* Add the following function as a request observer:
* Services.obs.addObserver(httpObserver, "http-on-examine-response", false);
milin / django.test.client import proble,
Created Jan 28, 2011
django.test.client import Client gives django_settings_module not specified problem
View django.test.client import proble,
import django
import httplib2
import time,urlparse,urllib
from django.conf import settings
import oauth2 as oauth
from django.test.client import Client
piroor / crash-with-crashreport.js
Last active Dec 31, 2015
Crash firefox by js-ctypes (run in the scratch pad or the browser console)
View crash-with-crashreport.js
var library ='nss3'));
var PR_Free = library.declare(
var ptr = new ctypes.voidptr_t(0123);
You can’t perform that action at this time.