Skip to content

Instantly share code, notes, and snippets.

View johnnymillergh's full-sized avatar
💪
Coding & Building

Johnny Miller johnnymillergh

💪
Coding & Building
View GitHub Profile
@jed
jed / LICENSE.txt
Created May 20, 2011 13:27 — forked from 140bytes/LICENSE.txt
generate random UUIDs
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@walkermatt
walkermatt / debounce.py
Created June 4, 2012 21:44
A debounce function decorator in Python similar to the one in underscore.js, tested with 2.7
from threading import Timer
def debounce(wait):
""" Decorator that will postpone a functions
execution until after wait seconds
have elapsed since the last time it was invoked. """
def decorator(fn):
def debounced(*args, **kwargs):
def call_it():
@erikreagan
erikreagan / mac-apps.md
Created August 4, 2012 19:18
Mac developer must-haves

Mac web developer apps

This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.

— Erik

@ajimix
ajimix / AutoHotkeyMacMapping.ahk
Created September 5, 2012 06:22
AutoHotkey script to remap some Mac shortcuts on Windows to make Windows more usable
#SingleInstance force
; Install autohotkey for windows and put the contents of this file in your
; documents folder AutoHotkey.ahk existing file.
#InstallKeybdHook
; Remap for Mac Like
!c::Send ^c
!+c::Send ^+c
@jonschlinkert
jonschlinkert / markdown-cheatsheet.md
Last active April 11, 2024 04:45
A better markdown cheatsheet.
@jackiekazil
jackiekazil / rounding_decimals.md
Last active January 17, 2024 12:29
How do I round to 2 decimals in python?

How do I round to 2 decimals?

In python, you have floats and decimals that can be rounded. If you care about the accuracy of rounding, use decimal type. If you use floats, you will have issues with accuracy.

All the examples use demical types, except for the original value, which is automatically casted as a float.

To set the context of what we are working with, let's start with an original value.

Original Value

@jbonney
jbonney / mysqldump.sh
Created August 30, 2013 22:04
MySQL dump to export data only (no DB schema nor table instructions). Particularly useful when exporting a Rails DB to re-import it afterwards in a DB that has been created through `rake db:drop db:create db:migrate`.
mysqldump --user="username" --password="password" --skip-triggers --compact --no-create-info --ignore-table="database_name.schema_migrations" --ignore-table="database_name.table_populated_through_migration" "database_name" > "dump.sql"
@csharpforevermore
csharpforevermore / AuthoHotKeyList.txt
Created April 27, 2014 15:50
AutoHotKey Key List
Key Name Resulting Keystroke
{F1} - {F24} Function keys. For example: {F12} is the F12 key.
{!} !
{#} #
{+} +
{^} ^
{{} {
{}} }
{Enter} ENTER key on the main keyboard
{Escape} or {Esc} ESCAPE
@renyu-io
renyu-io / Autohotkey.ahk
Last active January 10, 2022 06:32
Autohotkey for HHKB Windows (MAC OSX compatible)
; EMACS
^a::Send {Home}
^e::Send {End}
^b::Send {Left}
$^f::Send {Right}
^n::Send {Down}
^p::Send {Up}
^d::Send {Delete}
^h::Send {Backspace}