Skip to content

Instantly share code, notes, and snippets.

View iamdevlinph's full-sized avatar
💻
code code code 🍉

Devlin Pajaron iamdevlinph

💻
code code code 🍉
View GitHub Profile
@iamdevlinph
iamdevlinph / .tmux.conf
Created February 21, 2020 02:39
Tmux Config
# tmux 3.0a
# remap prefix from C-b to C-a
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# set pane using mouse
set -g mouse on
# make tmux use your preferred shell
@iamdevlinph
iamdevlinph / lock-pkg-versions.js
Last active July 28, 2018 14:56
Node script to lock versions of dependencies in package.json
const fs = require('fs');
const log = string => console.log(`\x1b[33m${string}\x1b[0m`);
log('\nRunning lock-version.js\nThe purpose of this script is to lock the npm versions of all packages to the current installed version to avoid breaking changes caused by accidental package updates.\n');
prompt('This will lock all package versions to the current version installed.\nThis will remove ^ and ~ from the version number\nProceed? y/n: ', proceed => {
proceed = proceed.toLowerCase();
switch (proceed) {
case 'y':
readFile();
# Create .tmux.conf in your home directroy
# This will hold tmux configurations
cd ~
nano .tmux.conf
@iamdevlinph
iamdevlinph / badges
Last active July 6, 2018 16:19
Github Shield Badges
Open Issues Count
https://img.shields.io/github/issues/<username>/<repo>.svg?style=for-the-badge
Close Issues Count
https://img.shields.io/github/issues-closed/<username>/<repo>.svg?style=for-the-badge
NPM Downloads
https://img.shields.io/npm/dm/<username>/<pkg_name>.svg?style=for-the-badge
Repo Size
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; Previous song
+F1::
Send {Media_Prev}
return
@iamdevlinph
iamdevlinph / missingeProvider.js
Last active July 11, 2017 07:37
Angular - find cause of "[$Injector:unpr] Unknown provider: eProvider <- e" when minified
// Just a tip for ppl debugging such issues in 1.2 -
// This is a short snippet I wrote that will print an error to the console with the contents of the guilty (minified) function.
// All you need to do is put a breakpoint before angular bootstraps, paste the snippet in the console and release the debugger.
Object.defineProperty(Function.prototype, '$inject', {
configurable: true,
get: function() {
return this.$injectHooked;
},
set: function (arr) {
function b64toBlob(dataURI) {
// convert base64 to raw binary data held in a string
// doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this
var byteString = atob(dataURI.split(',')[1]);
// separate out the mime component
var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0];
// write the bytes of the string to an ArrayBuffer
var ab = new ArrayBuffer(byteString.length);
@iamdevlinph
iamdevlinph / browserCheck.js
Last active July 31, 2020 07:40
Check Browser
// https://stackoverflow.com/a/56361977/4110257
function name() {
var agent = window.navigator.userAgent.toLowerCase();
switch (true) {
case agent.indexOf("edge") > -1: return "edge";
case agent.indexOf("edg") > -1: return "chromium based edge (dev or canary)";
case agent.indexOf("opr") > -1 && !!window.opr: return "opera";
case agent.indexOf("chrome") > -1 && !!window.chrome: return "chrome";
case agent.indexOf("trident") > -1: return "ie";