Skip to content

Instantly share code, notes, and snippets.

@Happy-Ferret
Happy-Ferret / emoji_image_replace.js
Created June 9, 2016 09:40 — forked from mwunsch/emoji_image_replace.js
Detect emoji unicode on a page, replace it with images (supplied by GitHub, for now). Goes great in your ~/.js
/**
*
* Here's a thing that will look through all the text nodes of a document, and
* upon encountering an emoji codepoint, will replace it with an image.
* For now, those images are pulled from GitHub, which isn't very nice, so I
* need to find a more suitable host.
*
* Much of this code was gleaned from staring at the minified GitHub JS.
*
* Copyright (c) 2013 Mark Wunsch. Licensed under the MIT License.
@Happy-Ferret
Happy-Ferret / emolist.js
Created June 9, 2016 09:45 — forked from ptantiku/emolist.js
Javascript to print out all emoticons on Facebook. Usage: open javascript console on the browser (e.x. ctrl+shift+j) then paste the code in.
var emolist=[
{"chars" : " :) ", "class" : "emoticon_smile", "name" : "Smiley"},
{"chars" : " :( ", "class" : "emoticon_frown", "name" : "Frown"},
{"chars" : " :P ", "class" : "emoticon_tongue", "name" : "Tongue"},
{"chars" : " :D ", "class" : "emoticon_grin", "name" : "Grin"},
{"chars" : " :o ", "class" : "emoticon_gasp", "name" : "Gasp"},
{"chars" : " ;) ", "class" : "emoticon_wink", "name" : "Wink"},
{"chars" : " :v ", "class" : "emoticon_pacman", "name" : "Pacman"},
{"chars" : " >:( ", "class" : "emoticon_grumpy", "name" : "Gruñón"},
{"chars" : " :/ ", "class" : "emoticon_unsure", "name" : "Unsure"},
@Happy-Ferret
Happy-Ferret / _ff-addon-snippet-EnumWindows.js
Created June 15, 2016 13:26 — forked from Noitidart/_ff-addon-snippet-EnumWindows.js
_ff-addon-snippet-EnumWindows - Using js-ctypes to try to do a EnumWindows with callback.
//https://github.com/nightwing/foximirror/blob/f40afb12beb512fb1d453afa028bc94c53f9326b/ctypes.picker.js#L8
Components.utils.import("resource://gre/modules/ctypes.jsm");
user32dll = ctypes.open('user32.dll');
var DWORD = ctypes.uint32_t;
var HANDLE = ctypes.size_t;
var HWND = HANDLE;
var BOOL = ctypes.bool;
var LPARAM = ctypes.size_t;
@Happy-Ferret
Happy-Ferret / README
Created June 27, 2016 09:56 — forked from bert/README
Embedding applications via XEmbed
From: [email protected] [mailto:[email protected]] On Behalf Of Andy Spencer
Sent: Friday, January 21, 2011 5:24 AM
To: Michael Treibton
Cc: [email protected]
Subject: Re: Embedding applications via XEmbed
On 2011-01-20 20:52, Michael Treibton wrote:
> I've read about GtkSocket and GtkPlug, but the examples for the
> official documentation don't make it clear to me how to go about this.
>
@Happy-Ferret
Happy-Ferret / taking screenshot in linux with C
Created June 27, 2016 18:42 — forked from bozdag/taking screenshot in linux with C
This C program takes the whole screenshot of the root window for a given display and saves it in PNG file format.
/*
Grabs a screenshot of the root window.
Usage : ./scr_tool <display> <output file>
Example : ./scr_tool :0 /path/to/output.png
Author: S Bozdag <[email protected]>
*/
@Happy-Ferret
Happy-Ferret / Observer.js
Created July 22, 2016 07:24 — forked from fundon/Observer.js
Observer Design Pattern Using JavaScript
/*
Notes:
Observer Event Pub/Sub
add → bind → subscribe
remove → unbind → unsubscribe
notify → trigger → publish
topic → type → topic
*/
/**
* Observer Class
@Happy-Ferret
Happy-Ferret / 0_reuse_code.js
Created July 27, 2016 07:14
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
var app = require('app');
var dockMenu = [
{ label: 'New Window', click: () => newWindow() },
{ label: 'New Private Window', click: () => newWindow({isPrivate:true}) },
];
app.dock.setMenu(dockMenu);
var BrowserWindow = require('browser-window');
@Happy-Ferret
Happy-Ferret / encrypted-git-repo.md
Created August 23, 2016 19:29
Transparent Git Encryption

Transparent Git Encryption

This document has been modified from its [original format][m1], which was written by Ning Shang ([email protected]). It has been updated and reformatted into a [Markdown][m2] document by [Woody Gilk][m3] and [republished][m4].

Description

When working with a remote git repository which is hosted on a third-party storage server, data confidentiality sometimes becomes

@Happy-Ferret
Happy-Ferret / gist:0bb6c7a2ebb6ed94dbb11b5cb9a0aa85
Created August 30, 2016 03:06 — forked from klovadis/gist:1293127
Private class methods using the commonjs module system
// ----- throw your class into one single file = a seperate scope
// constructor and export
var myClass = module.exports = function () {
// ..
}
// a public method
myClass.prototype.publicMethod = function () {