Skip to content

Instantly share code, notes, and snippets.

@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 / require.js
Created August 20, 2016 18:06
require Junior
const { require } = Components.utils.import("resource://gre/modules/commonjs/toolkit/require.js", {})
var system = require("./HuX/main");
system.puts("Hello World from libc!");
system.puts("Hello HuX!");
@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 () {