Skip to content

Instantly share code, notes, and snippets.

@Happy-Ferret
Happy-Ferret / feh_or_browser.lua
Created June 15, 2018 15:17 — forked from Donearm/feh_or_browser.lua
Open a url with feh, if it leads to an image, or firefox, in all other cases
#!/usr/bin/env lua
---
-- @author Gianluca Fiore
-- @copyright 2012, Gianluca Fiore <[email protected]>
--
--
-- Open a url with feh, if it leads to an image, or firefox, in all
-- other cases. Trivial but very useful with cli newsreaders (like
-- newsbeuter) to quickly preview images and to not have to switch to
@Happy-Ferret
Happy-Ferret / session_manager_setup.sh
Created June 15, 2018 08:33 — forked from awilhite/session_manager_setup.sh
Start Chrome OS With Flags. Overide Existing File in /sbin/session_manager_setup.sh
#!/bin/sh
# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Set up to start the X server ASAP, then let the startup run in the
# background while we set up other stuff.
XAUTH_FILE="/var/run/chromelogin.auth"
MCOOKIE=$(head -c 8 /dev/urandom | openssl md5) # speed this up?
@Happy-Ferret
Happy-Ferret / crouton.conf
Created June 11, 2018 19:37 — forked from DennisLfromGA/crouton.conf
A ChromeOS upstart script to kick-off a crouton chroot desktop environment.
# Copyright (c) 2016 The crouton Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
## Filename: /etc/init/crouton.conf
## NOTE: 'rootfs' verification needs to be removed.
## crouton chroot - Start session
##
## This will start a (crouton) chroot Desktop Environment session
@Happy-Ferret
Happy-Ferret / _README.md
Created June 7, 2018 05:37 — forked from morganrallen/_README.md
Janky Browser

JankyBrowser

The only cross-platform browser that fits in a Gist!

One line install. Works on Linux, MacOSX and Windows.

Local Install

$&gt; npm install http://gist.github.com/morganrallen/f07f59802884bcdcad4a/download
@Happy-Ferret
Happy-Ferret / delete_git_submodule.md
Created April 25, 2018 15:13 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@Happy-Ferret
Happy-Ferret / values_pointers.go
Created April 19, 2018 06:09 — forked from josephspurrier/values_pointers.go
Golang - Asterisk and Ampersand Cheatsheet
/*
********************************************************************************
Golang - Asterisk and Ampersand Cheatsheet
********************************************************************************
Also available at: https://play.golang.org/p/lNpnS9j1ma
Allowed:
--------
p := Person{"Steve", 28} stores the value
@Happy-Ferret
Happy-Ferret / spectre.c
Created April 16, 2018 04:35 — forked from ErikAugust/spectre.c
Spectre example code
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#else
#include <x86intrin.h> /* for rdtscp and clflush */
#endif
@Happy-Ferret
Happy-Ferret / example.js
Created April 3, 2018 16:55 — forked from cosinusoidally/example.js
Garbage collector safe example embedding ChakraCore in Spidermonkey shell using js-ctypes
/*
Tested against release/1.4 branch of https://github.com/Microsoft/ChakraCore
commit: 6f4c890505a58bbf198035d4b93bf8a726033af3
The below program will work on x86_64 Linux. It demonstrates how to safely call
in to libChakraCore from Spidermonkey using js-ctypes. Because the ChakraCore
GC scans the stack for JsValueRefs we must allocate JsValueRefs on the C stack.
When I say C stack I mean in the memory region between the current stack
pointer and the initial value of the stack pointer when the program started.
Components.utils.import("resource://gre/modules/ctypes.jsm")
var liblog = ctypes.open('liblog.so');
var android_log = liblog.declare("__android_log_write",
ctypes.default_abi,
ctypes.int32_t,
ctypes.int32_t,
ctypes.char.ptr,
ctypes.char.ptr);