Skip to content

Instantly share code, notes, and snippets.

View clamstew's full-sized avatar
🧘
🎨 🤖 🚀 vibe-coding 24/7. Let's Go!

Clay Stewart clamstew

🧘
🎨 🤖 🚀 vibe-coding 24/7. Let's Go!
View GitHub Profile
@clamstew
clamstew / npm-check-updates.sh
Created October 21, 2017 23:01
A bash script to be able to run `yarn display-npm-updates` and safely run ncu (npm-check-updates) with a warning message if the user / dev does not have it installed
#!/bin/bash
echo 'checking for package.json updates using npmjs.com/package/npm-check-updates' >&2
# define some fun output colors - https://stackoverflow.com/questions/5947742
RED='\033[0;31m'
BLUE='\033[0;34m'
YELLOW='\033[1;33m'
GREEN='\033[0;32m'
NC='\033[0m' # No Color
@clamstew
clamstew / universal-module.js
Created September 15, 2017 06:43 — forked from millermedeiros/universal-module.js
Universal JavaScript Module, supports AMD (RequireJS), Node.js, and the browser.
(function(def){
def('myModule', ['someDependency', 'somethingElse'], function(someDependency, somethingElse){
//return the module's API
return {};
});
}(
// wrapper to run code everywhere
typeof define === 'function' && define.amd?
@clamstew
clamstew / cookies.js
Created September 14, 2017 17:31 — forked from CrocoDillon/cookies.js
Export your awesome module using AMD, CommonJS, Node.js or just as global.
/*
* Inspiration (well… copy pasting more or less) from:
* https://github.com/ScottHamper/Cookies/blob/0.3.1/src/cookies.js#L127-L140
*
* Thanks Scott!
*/
(function (global) {
'use strict';
var MyModule = function () {
@clamstew
clamstew / osx_chrome_insecure
Created May 17, 2017 15:54 — forked from wangsha/osx_chrome_insecure
osx run chrome in insecure mode
open -a Google\ Chrome --args --disable-web-security --allow-running-insecure-content
@clamstew
clamstew / README.md
Created April 14, 2017 16:13 — forked from joyrexus/README.md
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
var nextLink;
function open_page(url) {
console.log("Opening " + url);
osmosis.get(url)
.find('#nav td:last a')
.set({
'nextLink': '@href'
})
.find('.g')
.set({
var nextLink;
function open_page(url) {
console.log("Opening " + url);
osmosis.get(url)
.find('#nav td:last a')
.set({
'nextLink': '@href'
})
.find('.g')
.set({
[alias]
cleanfeature = branch --merged | grep "feature/" | xargs -n 1 git branch -d
[merge]
tool = p4mergetool
renameLimit = 8000
[mergetool "p4mergetool"]
cmd = /Applications/p4merge.app/Contents/Resources/launchp4merge $PWD/$BASE $PWD/$REMOTE $PWD/$LOCAL $PWD/$MERGED
trustExitCode = false
[mergetool]
keepBackup = false
@clamstew
clamstew / delete_all_merged_branches_on_git_repo.sh
Created February 28, 2017 20:05
deletes all merged branches on git repo
git branch --remote --merged |
grep origin |
grep -v '>' |
grep -v master |
grep -v develop |
# grep -v <any-other-branch-name-you-want-to-keep> |
xargs -L1 |
cut -d"/" -f2- |
xargs git push origin --delete