Instantly share code, notes, and snippets.

View fix-dictionaries.bat
@echo off
set regPath="HKEY_CURRENT_USER\Software\Microsoft\Spelling\Dictionaries"
set regName="_Global_"
set truncate=true
if "%truncate%"=="true" (
reg ADD %regPath% /t REG_MULTI_SZ /v %regName% /d "C:\Users\%USERNAME%\AppData\Roaming\Microsoft\Office\16.0\be70806f\Proofing\RoamingCustom.dic" /f
) else (
for /f "tokens=2*" %%a in ('REG QUERY %regPath% /v %regName%') do set "regData=%%~b"
View create-app-logo-sizes.bat
@echo off
cls
echo Creating 59 icons, please wait.
im-convert ../../src/assets/images/app-logo-no-gradient.png ^
( -clone 0 -resize 2208x1242 -background #1f3165 -gravity center -extent 2208x1242 -write ../../platforms/ios/Assess/Images.xcassets/LaunchImage.launchimage/Default-Landscape-736h.png ) ^
( -clone 0 -resize 2048x1536 -background #1f3165 -gravity center -extent 2048x1536 -write ../../platforms/ios/Assess/Images.xcassets/LaunchImage.launchimage/Default-Landscape@2x~ipad.png ) ^
( -clone 0 -resize 2048x1536 -background #1f3165 -gravity center -extent 2048x1536 -write ../screen/ios/screen-ipad-landscape@2x.png ) ^
View config
[alias]
swaplast = !git tag _invert && git reset --hard HEAD~2 && git cherry-pick _invert _invert~1 && git tag -d _invert
invertindex = !git commit -m tmp1 && git add -A && git commit -m tmp2 && git swaplast && git reset HEAD~1 && git reset HEAD~1 --soft
cleanup = !git clean -df
allclean = !git reset --hard && git cleanup
quickclean = !git checkout . & git cleanup
View stripe.md
  • Original Stripe button

stripe

  • With Bootstrap 3 styles applied

bootstrap

View merge.js
/**
* Recursively merge properties
* and return a new object
* `merge(a, b[, ...])`
*
* @return object
*/
function merge() {
var dst = {},
src,
View path.php
<?php
// Absolute
$path = current(preg_split('@(?<=public)@', getcwd()));
require_once "{$path}\includes\config.inc.php";
// Relative
$path = preg_split('/public/', getcwd());
$path = explode(DIRECTORY_SEPARATOR, trim(end($path), DIRECTORY_SEPARATOR));
require_once str_repeat('../', count($path)) . 'includes/config.inc.php';
View config.md
  • Exclude dirs: .git|node_modules|vendor|storage|framework7|laravel-framework|cache
  • File Names match: *.env*|*.js|*.md|*.php|*css|*.xml|*.html|*.json|artisan|*.vue|*config|*access|*.bat|*.yml|*.ics|*.csv|*.xml|*.log|-*lock.*
View relative.php
<?php
function getRelativeTime($timestamp) {
$difference = strtotime(date('Y-m-d H:i:s')) - strtotime($timestamp);
$periods = ['second', 'minute', 'hour', 'day', 'week', 'month', 'year', 'decade'];
$lengths = [60, 60, 24, 7, 4.35, 12, 10];
// This was in the past
if ($difference >= 0) {
$ending = 'ago';
// This was in the future
View contextMenu.xml
<?xml version="1.0" encoding="UTF-8" ?>
<NotepadPlus>
<ScintillaContextMenu>
<Item MenuEntryName="Macro" MenuItemName="Select Current Line" />
<Item PluginEntryName="HTML Tag" PluginCommandItemName="Select tag contents only" ItemNameAs="Select Tag Contents" />
<Item MenuEntryName="Macro" MenuItemName="Delete Current Line" />
<Item MenuEntryName="Macro" MenuItemName="Remove Duplicate Lines" />
<Item id="0" />
<Item MenuEntryName="Macro" MenuItemName="Title Case" />
<Item MenuEntryName="Macro" MenuItemName="Sentence case." />
View keybase.md

Keybase proof

I hereby claim:

  • I am u01jmg3 on github.
  • I am jgoode (https://keybase.io/jgoode) on keybase.
  • I have a public key whose fingerprint is FA3B 9BB0 3697 615A 12DA A667 3377 861B 1185 8871

To claim this, I am signing this object: