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
@Noitidart
Noitidart / e.js
Last active Jun 16, 2019 — forked from 1yzo/e.js
View e.js
if (typeof unreg !== 'undefined') unreg();
function logOnline() {
console.log('ONLINE', new Date().toLocaleTimeString())
}
function logOffline() {
console.log('offline', new Date().toLocaleTimeString())
}
function reg() {
window.addEventListener('online', logOnline);
@Noitidart
Noitidart / casesafe.sh
Created Dec 20, 2018 — forked from scottsb/casesafe.sh
Create and manage a case-sensitive disk-image on macOS (OS X).
View casesafe.sh
#!/bin/bash
# ---------------------------------------------------------
# Customizable Settings
# ---------------------------------------------------------
MOUNT_POINT="${CASE_SAFE_MOUNT_POINT:-${HOME}/casesafe}"
VOLUME_PATH="${CASE_SAFE_VOLUME_PATH:-${HOME}/.casesafe.dmg.sparseimage}"
VOLUME_NAME="${CASE_SAFE_VOLUME_NAME:-casesafe}"
VOLUME_SIZE="${CASE_SAFE_VOLUME_SIZE:-60g}"
View regex-weburl.js
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Updated: 2010/12/05
// License: MIT
//
// Copyright (c) 2010-2013 Diego Perini (http://www.iport.it)
//
// Permission is hereby granted, free of charge, to any person
@Noitidart
Noitidart / base-neg-2.js
Created Jul 4, 2017 — forked from adamloving/base-neg-2.js
Toptal Codility Problem: Convert to-and-from base -2
View base-neg-2.js
'use strict';
function toDecimal(A) {
var sum = 0;
for (var i = 0; i < A.length; i++) {
sum += A[i] * Math.pow(-2, i);
}
return sum;
}
View x11-keylogger.c
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <signal.h>
#include <string.h>
#include <unistd.h> // for usleep() only
#include <sys/time.h>
#include <sys/types.h>
#include <time.h>
@Noitidart
Noitidart / ba-issemver.js
Created Oct 12, 2016 — forked from cowboy/ba-issemver.js
isSemVer - semantic version comparison for JavaScript
View ba-issemver.js
/*!
* isSemVer - v0.1 - 9/05/2010
* http://benalman.com/
* http://semver.org/
*
* Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
@Noitidart
Noitidart / AXWindow.swift
Created Sep 29, 2016 — forked from tylerlong/AXWindow.swift
Make window frontmost (BUT not floating. I don't know how to make windows floating)
View AXWindow.swift
import Cocoa
class AXWindow {
let app: AXUIElement
let window: AXUIElement
init(app: AXUIElement, window: AXUIElement) {
self.app = app
self.window = window
@Noitidart
Noitidart / _ff-addon-snippet-AccessBootstrapScope.js
Last active Aug 17, 2016 — forked from yajd/_ff-addon-snippet-AccessBootstrapScope.js
_ff-addon-snippet-AccessBootstrapScope - example of how to access addon module scope of bootstrapped addon
View _ff-addon-snippet-AccessBootstrapScope.js
var getScope = function(aAddonId) { var XPIScope = Cu.import('resource://gre/modules/addons/XPIProvider.jsm'); return XPIScope.XPIProvider.activeAddons.get(aAddonId).bootstrapScope; }; a = getScope('MouseControl@jetpack');
@Noitidart
Noitidart / example.cpp
Created Apr 9, 2016 — forked from taxilian/example.cpp
partial example of global keyboard event handler
View example.cpp
void *EventLoop(void *args)
{
int state;
pthread_setcancelstate (PTHREAD_CANCEL_ENABLE, &state);
pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, &state);
// In one thread run the event loop to get hotkey presses
EventHotKeyID gMyHotKeyID1, gMyHotKeyID2;
EventTypeSpec eventType;
You can’t perform that action at this time.