Skip to content

Instantly share code, notes, and snippets.

@Happy-Ferret
Happy-Ferret / skel.hs
Created May 17, 2014 23:20
*nix utility skeleton in Haskell
{- Released as "All Rights Reserved"
until further notice/application of a formal license -}
module Main where
import System.Environment
import Control.Monad
import System.Exit
main :: IO ()
main = getArgs >>= parse >>= putStr
@Happy-Ferret
Happy-Ferret / foo.cpp
Created October 16, 2015 06:36 — forked from NorioKobota/foo.cpp
exchange binary data between C++ and JavaScript by using linear-rpc - C++ part
/**
* $ git clone --recursive https://github.com/linaer-rpc/linear-cpp /path/to
* $ cd /path/to/linear-cpp
* $ ./bootstrap && ./configure && make
* $ cp /this/foo.cpp /path/to/linear-cpp/sample
* $ cd sample
* $ g++ -I ../include -I ../deps/msgpack/include -o foo foo.cpp ../src/.libs/liblinear.a ../deps/libtv/src/.libs/libtv.a ../deps/libtv/deps/libuv/.libs/libuv.a
* $ ./foo
*/
@Happy-Ferret
Happy-Ferret / Makefile
Created January 28, 2016 10:15 — forked from mietek/Makefile
Example Makefile for a Haskell project
all: test
ci: depclean test doc
PKG_DESCRIPTION = example.cabal
DEP = .cabal-sandbox
CONFIGURE = dist/setup-config
ifndef PREFIX
PREFIX = /usr/local
#!/bin/bash
echo -ne "\000\000\000\000" >&$1
echo -ne "\024\000\000\000" >&$1
echo -n "NOP FINISHED STARTUP" >&$1
echo -ne "\001\000\000\000" >&$1
echo -ne "\000\000\000\000" >&$1
echo -ne "\011\000\000\000" >&$1
echo -n "echo Test" >&$1
@Happy-Ferret
Happy-Ferret / sclg4.c
Created April 22, 2016 05:20 — forked from aktau/sclg4.c
A simple WinAPI GetAsyncKeyState()-based keylogger, written a very long time ago. I dug it out of the archives because of a Hacker News post (https://news.ycombinator.com/item?id=7607082). For educational purposes only, of course.
/**
* Copyright (c) 2006, Nicolas Hillegeer
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
@Happy-Ferret
Happy-Ferret / example.html
Created May 4, 2016 09:57
Load external html document into view
/* list.html */
<p class="marquee"><a id="movie.mp4" onclick="saveURI(this.id);" href="videoView.html">A stunning movie!</a></p>
/* */
/* loader.html */
<div id="videoList"/>
<script>
function saveURI(e)
{
https://www.kenneth-truyers.net/2013/04/27/javascript-namespaces-and-modules/
https://hungred.com/how-to/tutorial-function-function-javascript/
http://stackoverflow.com/questions/19872917/how-to-make-a-dot-function-in-javascript
http://stackoverflow.com/questions/12588655/jasmine-using-function-with-a-dot-in-the-name
@Happy-Ferret
Happy-Ferret / _ff-addon-snippet-X11_XChangeProperty.js
Created May 31, 2016 06:34 — forked from Noitidart/_ff-addon-snippet-X11_XChangeProperty.js
_ff-addon-snippet-X11_XChangeProperty - Changes the title of a window via _NET_WM_NAME. [jsctypes] [x11] [unix]
Cu.import('resource://gre/modules/ctypes.jsm')
var nixtypesInit = function() {
// BASIC TYPES (ones that arent equal to something predefined by me)
this.ATOM = ctypes.unsigned_long;
this.BOOL = ctypes.int;
this.CHAR = ctypes.char;
this.GDKDRAWABLE = ctypes.StructType('GdkDrawable');
this.GDKWINDOW = ctypes.StructType('GdkWindow');
this.DISPLAY = new ctypes.StructType('Display');
@Happy-Ferret
Happy-Ferret / _ff-addon-snippet-fuser_fread.js
Created May 31, 2016 08:06 — forked from Noitidart/_ff-addon-snippet-fuser_fread.js
_ff-addon-snippet-fuser_fread - trying to get fuser and fread from libc
Cu.import('resource://gre/modules/ctypes.jsm');
function doit() {
var _libc = ctypes.open('libc.so.6');
var _x11 = ctypes.open('libX11.so.6');
var popen = _x11.declare('popen', ctypes.default_abi, ctypes.voidptr_t, // Return int
ctypes.char.ptr, // Param1 const char *command
ctypes.char.ptr // Param1 const char *command
@Happy-Ferret
Happy-Ferret / _ff-addon-snippet-WinAPI-ShowWindowHide.js
Created May 31, 2016 08:10 — forked from Noitidart/_ff-addon-snippet-WinAPI-ShowWindowHide.js
_ff-addon-snippet-WinAPI-ShowWindowHide - Using js-ctypes and WinAPI method of ShowWindow to hide a window. [windows] [jsctypes]
Cu.import('resource://gre/modules/ctypes.jsm')
var wintypesInit = function() {
// BASIC TYPES (ones that arent equal to something predefined by me)
this.BOOL = ctypes.bool;
this.HWND = ctypes.voidptr_t;
this.INT = ctypes.int;
// CONSTANTS
this.SW_HIDE = 0;