Skip to content

Instantly share code, notes, and snippets.

View Lokno's full-sized avatar

Jonathan Decker Lokno

View GitHub Profile
@CatTrinket
CatTrinket / redd.py
Last active August 20, 2020 23:21
The expected amount of time it takes to complete the art wing of the museum in Animal Crossing: New Horizons
from datetime import date, timedelta
from fractions import Fraction as F
def tries_before_next(already_collected):
"""How many more real pieces you'll need to buy on average to get the next
new one
"""
chance_new = F(43 - already_collected, 43)
/*
Dowsing
Copyright 2020 Clairvoire 2020
clairvoire@gmail.com //// \
| |
[ ] ___| _|___
// ` v`) __ __ ||___|___|_|
o / \ o/ o/ |_|_____|_||
> o o / \ _____\|v v / |____
@if [%6]==[] goto error
@goto ok
:error
@echo USAGE: video2gif START_TIME DURATION WIDTH FRAME_RATE (DITHER_OPTIONS) (CROP_RECTANGLE width:height:x:y) (EQ_OPTIONS) INPUT OUTPUT
@goto end
:ok
@set PALETTE="%TEMP%\palette.png"
@chrpinedo
chrpinedo / insert-signature-in-pdf.md
Created April 4, 2016 10:27
How to insert your signature in a PDF file by using PDFtk

How to insert your signature in a PDF file by using PDFtk

Your signature in all the sheets

  1. convert the signature image to PDF file
convert firma.png firma.pdf
@Wynout
Wynout / Sublime-Text.desktop
Created July 10, 2013 08:46
Pin Sublime Text to Ubuntu Unity. Save text in launcher "~/.local/share/applications/Sublime-Text.desktop". Replace "###" with path to ST. Drag and drop the launcher from ".local/share/applications" to the Launcher Bar on the left on your Screen. When pinned to bar: Right-click shows "Create Editor Window". Accepts file drop of files you want to…
[Desktop Entry]
Type=Application
Terminal=false
Name=Sublime Text 2
StartupNotify=true
GenericName=Text Editor
Comment=Edit text files
Exec=/###/###/SublimeText2/sublime_text %U
MimeType=text/plain;text/x-chdr;text/x-csrc;text/x-c++hdr;text/x-c++src;text/x-java;text/x-dsrc;text/x-pascal;text/x-perl;text/x-python;application/x-php;application/x-httpd-php3;application/x-httpd-php4;application/x-httpd-php5;application/xml;text/html;text/css;text/x-sql;text/x-diff;x-directory/normal;inode/directory;
Categories=GNOME;GTK;Utility;TextEditor;Application;Development;
@1wErt3r
1wErt3r / SMBDIS.ASM
Created November 9, 2012 22:27
A Comprehensive Super Mario Bros. Disassembly
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY
;by doppelganger (doppelheathen@gmail.com)
;This file is provided for your own use as-is. It will require the character rom data
;and an iNES file header to get it to work.
;There are so many people I have to thank for this, that taking all the credit for
;myself would be an unforgivable act of arrogance. Without their help this would
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no
@rygorous
rygorous / gist:2203834
Created March 26, 2012 08:03
float->sRGB8 using SSE2 (and a table)
// float->sRGB8 conversions - two variants.
// by Fabian "ryg" Giesen
//
// I hereby place this code in the public domain.
//
// Both variants come with absolute error bounds and a reversibility and monotonicity
// guarantee (see test driver code below). They should pass D3D10 conformance testing
// (not that you can verify this, but still). They are verified against a clean reference
// implementation provided below, and the test driver checks all floats exhaustively.
//
@rygorous
rygorous / gist:2156668
Last active June 7, 2024 08:21
float->half variants
// float->half variants.
// by Fabian "ryg" Giesen.
//
// I hereby place this code in the public domain, as per the terms of the
// CC0 license:
//
// https://creativecommons.org/publicdomain/zero/1.0/
//
// float_to_half_full: This is basically the ISPC stdlib code, except
// I preserve the sign of NaNs (any good reason not to?)
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
@gka
gka / twitter_follower_intersect.py
Created September 15, 2011 16:16
Looks up how many followers two Twitter accounts do have in common
#!/usr/bin/env python
"""
This script looks up how many followers two different Twitter accounts do have in common.
Usage:
twitter_follower_intersect.py username username
You'll need Python and the Python Twitter Tools to get this running.