Skip to content

Instantly share code, notes, and snippets.

View didymu5's full-sized avatar

Tommy Wu didymu5

  • Los Angeles
  • 16:13 (UTC -12:00)
View GitHub Profile
@remarkablemark
remarkablemark / README.md
Last active November 14, 2023 08:55
How to mock `window.location.reload` in Jest and jsdom: https://remarkablemark.org/blog/2018/11/17/mock-window-location/
@bigsergey
bigsergey / review-checklist.md
Last active April 14, 2024 01:57
Front-end Code Review Checklist

Review checklist

General

  1. Does the code work?
  2. Description of the project status is included.
  3. Code is easily understand.
  4. Code is written following the coding standarts/guidelines (React in our case).
  5. Code is in sync with existing code patterns/technologies.
  6. DRY. Is the same code duplicated more than twice?
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active April 25, 2024 02:01
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@nodesocket
nodesocket / gist:3919205
Created October 19, 2012 16:33
All world timezones in an HTML select element
<select name="timezone_offset" id="timezone-offset" class="span5">
<option value="-12:00">(GMT -12:00) Eniwetok, Kwajalein</option>
<option value="-11:00">(GMT -11:00) Midway Island, Samoa</option>
<option value="-10:00">(GMT -10:00) Hawaii</option>
<option value="-09:50">(GMT -9:30) Taiohae</option>
<option value="-09:00">(GMT -9:00) Alaska</option>
<option value="-08:00">(GMT -8:00) Pacific Time (US &amp; Canada)</option>
<option value="-07:00">(GMT -7:00) Mountain Time (US &amp; Canada)</option>
<option value="-06:00">(GMT -6:00) Central Time (US &amp; Canada), Mexico City</option>
<option value="-05:00">(GMT -5:00) Eastern Time (US &amp; Canada), Bogota, Lima</option>
@plapier
plapier / gist:2044437
Created March 15, 2012 14:22
CSS/Sass Modal Dialog
<!-- HTML -->
<div class="modal-dialog-background">
<div class="modal-dialog">
<h1>Submit</h1>
<div class="inner-wrapper">
<p>Press submit to record your answers.</p>
</div>
<div class="buttons">
<button type="button" class="cancel">Cancel</button>
<button type="button" class="submit">Submit</button>
@aisipos
aisipos / jsonp-in-flask.py
Created July 20, 2011 01:20 — forked from farazdagi/jsonp-in-flask.py
JSONP in Flask
import json
from functools import wraps
from flask import redirect, request, current_app
def support_jsonp(f):
"""Wraps JSONified output for JSONP"""
@wraps(f)
def decorated_function(*args, **kwargs):
callback = request.args.get('callback', False)
if callback: