Skip to content

Instantly share code, notes, and snippets.

View alvin-milton's full-sized avatar
🤠
yee haw

Alvin Milton alvin-milton

🤠
yee haw
  • New York
View GitHub Profile
@alvin-milton
alvin-milton / empty-trash-via-hammerspoon.md
Last active September 10, 2020 22:43
Using Hammerspoon to empty the Trash

Fun w Hammerspoon

How many times do you empty your trash?

If you are like me, sometimes a lot, sometimes never.

It really depends on how long you tend to keep certain files in your system.

I wanted to automate the emptying of the trash.

Keybase proof

I hereby claim:

  • I am alvin-milton on github.
  • I am alvinmilton (https://keybase.io/alvinmilton) on keybase.
  • I have a public key ASBc8LD_tFR31Tov53qdJRDI1ykSc2bhrMN_bgPnEc_IDgo

To claim this, I am signing this object:

@alvin-milton
alvin-milton / .htaccess
Created April 8, 2019 19:11 — forked from schilke/.htaccess
Extend .htaccess (with Cachify directives) for better Caching/Compression
# To make sure
mod_gzip_on Yes
# Optional
AddDefaultCharset UTF-8
# BEGIN ADD MIME TYPES
<IfModule mod_mime.c>
AddType text/css .css
AddType text/x-component .htc
@alvin-milton
alvin-milton / linktargetcheck.js
Created November 30, 2018 16:16
Checks to see if links have targets, what they are, if not what link has a missing target
$('a').each(function () {
if ($(this).attr('target')) {
console.log($(this).attr('target'))
console.log('target set', $(this).attr('href'))
} else {
console.log('no target set', $(this).attr('href'))
}
})
@alvin-milton
alvin-milton / package.json
Created May 9, 2018 15:58 — forked from addyosmani/package.json
npm run-scripts boilerplate
{
"name": "my-app",
"version": "1.0.0",
"description": "My test app",
"main": "src/js/index.js",
"scripts": {
"jshint:dist": "jshint src/js/*.js",
"jshint": "npm run jshint:dist",
"jscs": "jscs src/*.js",
"browserify": "browserify -s Validating -o ./dist/js/build.js ./lib/index.js",
@alvin-milton
alvin-milton / grep.txt
Created February 8, 2018 22:25
Finds things via command line, and then saves output to a file
grep --include=\*.php -rnw '../themes/' -e 'cat' > results.txt
@alvin-milton
alvin-milton / search.js
Created February 8, 2018 18:09
find iframes with matterport & wellcomemat videos
$('iframe').each(function()
{
if ($(this).attr('src').indexOf('matterport.com') > -1)
{
console.log($(this).attr('src'))
}
if ($(this).attr('src').indexOf('wellcomemat.com') > -1)
{
console.log($(this).attr('src'))
}
@alvin-milton
alvin-milton / ultimate-ut-cheat-sheet.md
Created January 27, 2017 05:20 — forked from yoavniran/ultimate-ut-cheat-sheet.md
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai and Sinon

The Ultimate Unit Testing Cheat-sheet

For Mocha, Chai and Sinon

using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies


@alvin-milton
alvin-milton / index.html
Created November 21, 2016 20:41 — forked from anonymous/index.html
Post Landing page tech
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<pre>
===================
@alvin-milton
alvin-milton / math.js
Created May 13, 2016 15:31
Write a function accepts numbers as strings and adds them. Return them as strings.
function validateInput(a) {
var valid = a >= 0 ? a : false;
return valid;
}
function doIt(a, b) {
var arr = [],
i = 0,
x = parseInt(a, 10),