Skip to content

Instantly share code, notes, and snippets.

View kevinSuttle's full-sized avatar

Kevin Suttle kevinSuttle

View GitHub Profile
@kevinSuttle
kevinSuttle / README.md
Last active December 22, 2015 18:45 — forked from anonymous/README.md
JSON-LD Playground: Icon Schema

Icon Schema

This gist was automatically created by the JSON-LD Playground. You can see it loaded there by visiting:

http://json-ld.org/playground/index.html#/gist/3c379dfb9c1086e6e686
@kevinSuttle
kevinSuttle / new-issue-template.js
Created December 11, 2015 19:38
GitHub Issue Template
javascript:(function() {var e = document.getElementById('issue_body');if (e) {e.value += '# What? Why?\n\n\n# How was it tested?\n\n';}})();
@kevinSuttle
kevinSuttle / uninstall-java.sh
Created October 3, 2015 03:32
Java can DIAF
#!/usr/bin/env bash
sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin;
sudo rm -fr /Library/PreferencePanes/JavaControlPanel.prefpane;
# sudo find /Library/Java/JavaVirtualMachines -name "jdk*" -print0 -maxdepth 1 -type d -print0|xargs -0 rm -rd --;
sudo ln -sf /System/Library/Java/Support/Deploy.bundle/Contents/Resources/JavaPlugin2_NPAPI.plugin /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin;
sudo ln -sf /System/Library/Frameworks/JavaVM.framework/Commands/javaws /usr/bin/javaws;
@kevinSuttle
kevinSuttle / app.js
Created July 31, 2015 15:20
Loading multiple API credentials into a Node app
'use strict';
var express = require('express');
var app = express();
var config = require('./config');
// [...]
// [...]
var analytics = new Analytics(config.segment.writeKey, { flushAt: 1 });
@kevinSuttle
kevinSuttle / notes-backup.sh
Last active August 29, 2015 14:25
Bash 3.2: copy specific file names and files with specific extensions
#!/usr/bin/env bash
declare -a backup_files=(*.{id,nsf}, desktop8.ndk archive user.dic);
declare -a notes_data_directory=~/Library/Application\ Support/IBM\ Notes\ Data/;
declare -a notes_backup_directory=~/Desktop/Notes\ Backup;
mkdir -p "$notes_backup_directory";
cd "$notes_data_directory";
for i in "${backup_files[@]}"
@kevinSuttle
kevinSuttle / getCookie.js
Created June 18, 2015 05:09
Get cookie value with escaped quotes.
function getCookie(cookieName) {
if (!cookieName) { return null; }
return decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*" + encodeURIComponent(cookieName).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=\\s*([^;]*).*$)|^.*$"), "$1")).replace(/['"]+/g, '') || null;
}
// Original function
// https://developer.mozilla.org/en-US/docs/Web/API/document/cookie#A_little_framework.3A_a_complete_cookies_reader.2Fwriter_with_full_unicode_support
@kevinSuttle
kevinSuttle / getGHiemails.sh
Last active June 17, 2022 12:36
User emails API
❯ curl -H "Authorization: token MY_TOKEN" -H "X-Oauth-Scope: user:email" "https://api.github.com/users/kevinSuttle"
{
"login": "kevinSuttle",
"id": 95672,
"avatar_url": "https://avatars.githubusercontent.com/u/95672?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/kevinSuttle",
"html_url": "https://github.com/kevinSuttle",
"followers_url": "https://api.github.com/users/kevinSuttle/followers",
"following_url": "https://api.github.com/users/kevinSuttle/following{/other_user}",
@kevinSuttle
kevinSuttle / VS Code settings.json
Last active September 16, 2022 09:44
Visual Studio Code Settings
{
"editor.fontFamily": "Fira Code",
"editor.fontSize": 14,
"editor.formatOnSave": true,
"editor.renderWhitespace": "all",
"editor.tabSize": 2,
"editor.wordWrap": "on",
"flow.useNPMPackagedFlow": true,
"javascript.format.enable": false,
"javascript.validate.enable": false,
@kevinSuttle
kevinSuttle / app.js
Last active September 6, 2018 12:13
Socket.io, Express-generator troubleshooting
var express = require('express'),
https = require('https');
//...
var app = express();
// ...
module.exports = app;
@kevinSuttle
kevinSuttle / keybase.md
Last active October 21, 2015 04:35
Keybase GitHub verification

Keybase proof

I hereby claim:

  • I am kevinSuttle on github.
  • I am kevinsuttle (https://keybase.io/kevinsuttle) on keybase.
  • I have a public key whose fingerprint is C367 BDA4 7209 C1E0 A0A4 2F67 E2AE A467 FDD5 8B8F

To claim this, I am signing this object: