Skip to content

Instantly share code, notes, and snippets.

View MatthewCallis's full-sized avatar
🍖
Hungry Goriya

Matthew Callis MatthewCallis

🍖
Hungry Goriya
View GitHub Profile
@MatthewCallis
MatthewCallis / notification.coffee
Created November 15, 2016 18:08
Simple Browser Notifications
notify: (title, options) ->
options.icon = options.icon or "#{window.location.protocol}//#{window.location.hostname}#{$('meta#icon-120x120').attr('href')}"
# Check for notification compatibility, if browser version is unsupported, be silent.
return unless window.Notification
# If the user has not been asked to grant or deny notifications from this domain
if Notification.permission is 'default'
Notification.requestPermission ->
@notify(title, options)
# If the user has granted permission for this domain to send notifications.
else if Notification.permission is 'granted'
@MatthewCallis
MatthewCallis / SNES TODO.md
Created January 8, 2017 03:31
eludevisibility.org To-Do List

SNES Carts Need Labels Printed & Holes Cut:

@MatthewCallis
MatthewCallis / defer.coffee
Created September 18, 2015 17:58
Defer Loading of Scripts
downloadJSAtOnload = ->
scripts = [
{ src: '//www.googleadservices.com/pagead/conversion.js' } # Google Adwords
{ src: '//platform.twitter.com/oct.js' } # Twitter Conversion Tracking
{ src: "//js.hubspot.com/analytics/#{(Math.ceil(new Date()/300000)*300000)}/123456.js", id: 'hs-analytics' } # Hubspot
{ src: '//tag.perfectaudience.com/serve/SHASHASHASHASHASHA.js' } # Perfect Audience
{ src: '//cdn.bizible.com/_biz-a.js', id: 'bizible-settings' } # Bizible
{ src: "#{if ("https:" is document.location.protocol) then "https://s" else "http://a"}.adroll.com/j/roundtrip.js" } # Adroll
]
for script in scripts
@MatthewCallis
MatthewCallis / console.sass
Created March 3, 2017 19:10
Console Styles
.console
.warn
margin-top: 1em
label
font-weight: 700
input,
textarea
font-family: Monaco, Menlo, Consolas, "Courier New", monospace
font-size: 12px
line-height: 1.7em
@MatthewCallis
MatthewCallis / toggles.scss
Created November 3, 2017 18:17
CSS3 Toggles
// http://callmenick.com/2014/05/13/css-toggle-switch-examples/
$toggle-size: 26px;
$toggle-width: $toggle-size * 2;
$toggle-speed: 0.2s;
input {
&.toggle {
position: absolute;
// margin-left: -9999px
@MatthewCallis
MatthewCallis / u.php
Last active January 4, 2018 18:56
Drag & Drop File Upload
<?php
$max_file_size = 5 * 1024 * 1024 * 10; // 50MB
$path = "💎/"; # "~/domain.tld/cool_files/uploads/"; // Upload Directory, outside of web access dir.
// $valid_formats = array("rar","zip","7z","pdf","xlsx","xls","docx","doc","txt");
// $valid_formats_server = array(
// "application/pdf",
// "application/octet-stream",
// "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
// "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
// "application/msword",
@MatthewCallis
MatthewCallis / media_file_management.sh
Last active March 3, 2018 18:19
Media FIle Management Tasks
# Compress WAV Files with FLAC
find . -name "*.wav" -exec flac --best -A "tukey(0.5)" -A flattop --exhaustive-model-search --replay-gain --verify --delete-input-file {} \;
# Re-Encode FLAC Files
find . -name "*.flac" -exec flac --best -A "tukey(0.5)" -A flattop --exhaustive-model-search --replay-gain --force --verify {} \;
# Convert SHN to FLAC
for file in ./*.shn; do
ffmpeg -i "$file" "$file.flac"
done
@MatthewCallis
MatthewCallis / config.cson
Last active March 14, 2018 23:44
Atom Config
"*":
"activate-power-mode":
autoToggle: false
"atom-beautify":
general:
_analyticsUserId: "1096fe32-134e-4c2c-a217-2e8a6324be94"
"atom-color-highlight":
hideMarkersInComments: true
hideMarkersInStrings: true
"atom-ide-ui":
@MatthewCallis
MatthewCallis / styles.less
Last active April 3, 2018 20:29
Atom Styles
// https://github.com/tonsky/FiraCode/wiki/Atom-instructions
atom-text-editor {
text-rendering: optimizeLegibility; // Ligatures
-webkit-font-feature-settings: "liga" off, "calt" off;
}
// Cursor
atom-text-editor .cursor {
position: absolute;
border-left: 2px solid;
@MatthewCallis
MatthewCallis / kintaroinstaller.sh
Created August 14, 2018 04:29
Kintaro Super Kuma 9000 & Super Ursus Driver Install Script
#!/bin/bash
curl -s https://packagecloud.io/install/repositories/kintaro/pcb/script.deb.sh | sudo bash
sudo apt-get -y install kintarosnes