Skip to content

Instantly share code, notes, and snippets.

@Happy-Ferret
Happy-Ferret / show-all-256-colors.py
Created September 26, 2017 07:55 — forked from mgedmin/show-all-256-colors.py
Script to show all 256 colors supported by xterms
#!/usr/bin/python
"""Print a swatch using all 256 colors of 256-color-capable terminals."""
__author__ = "Marius Gedminas <[email protected]>"
__url__ = "https://gist.github.com/mgedmin/2762225"
__version__ = '2.0'
def hrun(start, width, padding=0):
@Happy-Ferret
Happy-Ferret / TrueColour.md
Created September 26, 2017 16:47 — forked from XVilka/TrueColour.md
True Colour (16 million colours) support in various terminal applications and terminals

Colours in terminal

It's a common confusion about terminal colours... Actually we have this:

  • plain ascii
  • ansi escape codes (16 colour codes with bold/italic and background)
  • 256 colour palette (216 colours + 16 ansi + 24 gray) (colors are 24bit)
  • 24bit true colour ("888" colours (aka 16 milion))
printf "\x1b[${bg};2;${red};${green};${blue}m\n"
void MovableObject::update()
{
Time newTime = Clock::now();
double frameTime = toSeconds(newTime-currentTime).count();
currentTime = Clock::now();
accumulator += frameTime;
while (accumulator >= dt)
{
@Happy-Ferret
Happy-Ferret / firefox_crack_linux.sh
Created December 2, 2017 15:08 — forked from zb3/firefox_crack_linux.sh
Crack firefox so that you can run unsigned extensions on linux, without recompiling firefox
#cracks for open source software are always cool....
#requires root privileges to replace omni.ja
#needs to be reapplied on reinstall
#you'll also need to set xpinstall.signatures.required to false
#and restart your browser
#tested on arch with FF48
OMNI_PATH=${1:-/usr/lib/firefox}
@Happy-Ferret
Happy-Ferret / mpc1.html
Created December 11, 2017 23:22 — forked from yurydelendik/mpc1.html
Minimal example for mozPrintCallback
<!DOCTYPE html>
<html dir="ltr" mozdisallowselectionprint moznomarginboxes>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<style>
* {
padding: 0;
margin: 0;
}
@Happy-Ferret
Happy-Ferret / .travis.yml
Created December 14, 2017 10:47 — forked from carlin-q-scott/.travis.yml
travis-ci build for firefox add-ons
language: node_js
node_js:
- "stable"
env:
global:
- DISPLAY=:99.0
- FIREFOX_BIN=./firefox/firefox
- JPM_FIREFOX_BINARY=./firefox/firefox
@Happy-Ferret
Happy-Ferret / _template-ff-addon-BootstrapURLIconWidget.xpi
Created December 15, 2017 07:55 — forked from Noitidart/_template-ff-addon-BootstrapURLIconWidget.xpi
_template-ff-addon-BootstrapURLIconWidget - This bootstrap addon shows how to add an icon to the URL bar and when clicked it opens a panel.
@Happy-Ferret
Happy-Ferret / put-icon-on-firefox-address-bar.js
Created December 15, 2017 07:57
Put action button icon on Firefox address bar
var loadUrlbarButton = function(doc, urlBtnClick) {
var urlBarIcons = doc.getElementById('urlbar-icons')
var btn = doc.createElement('toolbarbutton');
btn.setAttribute('id', 'my-id');
btn.setAttribute('image', require('sdk/self').data.url('my-icon.png'));
btn.addEventListener('command', urlBtnClick, false);
urlBarIcons.appendChild(btn);
return btn;
}
@Happy-Ferret
Happy-Ferret / Random Images on Refresh
Created December 22, 2017 05:57 — forked from stephenscaff/Random Images on Refresh
Super simple way to randomly load new images on refresh via Jquery and DOM injection. Great for banners.
<!DOCTYPE html>
<head>
<!--Little CSS fade in -->
<style>
.fade-in{
-webkit-animation: fade-in 2s ease;
-moz-animation: fade-in ease-in-out 2s both;
-ms-animation: fade-in ease-in-out 2s both;
-o-animation: fade-in ease-in-out 2s both;
@Happy-Ferret
Happy-Ferret / gist:a83d350337eb8fc722c9ca30c87e406e
Created December 22, 2017 05:58 — forked from srobbin/gist:3799775
Random Backstretch image
<script>
// Create an array of images that you'd like to use
var images = [
'image1.jpg'
, 'image2.jpg'
, 'image3.jpg'
];
// Get a random number between 0 and the number of images
var randomNumber = Math.floor( Math.random() * images.length );