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
angular.module('braintree-angular', []);
angular.module('braintree-angular').factory('braintreeWeb', [function() {
// braintree must already be loaded on the page
// see https://github.com/braintree/braintree-web for package
return window.braintree;
}]);

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

@clamstew
clamstew / forcelowercase.js
Last active October 5, 2016 02:31 — forked from dkarter/forcelowercase.js
Angular directive to force lowercase letters on an input textbox as you type
'use strict';
/**
* @ngdoc directive
* @name myapp.directive:forceLowerCase
* @description
* # forceLowerCase
*/
angular.module('myApp').directive('forceLowerCase', [
'$parse',
@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
var nextLink;
function open_page(url) {
console.log("Opening " + url);
osmosis.get(url)
.find('#nav td:last a')
.set({
'nextLink': '@href'
})
.find('.g')
.set({
@jimpick
jimpick / Dockerfile
Created June 24, 2017 02:54
Hosting dathttpd on now.sh - https://dat.jimpick.com/
FROM ubuntu:16.04
RUN apt-get update --yes && apt-get upgrade --yes
RUN apt-get update --yes && apt-get upgrade --yes
RUN apt-get -y install curl
RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
RUN apt-get -y install ffmpeg zlib1g-dev automake autoconf git \
@addyosmani
addyosmani / workbox.md
Last active January 20, 2024 16:14
Workbox recipes

Workbox runtime caching recipes

Your Service Worker script will need to import in Workbox and initialize it before calling any of the routes documented in this write-up, similar to the below:

importScripts('workbox-sw.prod.v1.3.0.js');
const workbox = new WorkboxSW();

// Placeholder array populated automatically by workboxBuild.injectManifest()
@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
// per https://docs.npmjs.com/misc/scripts, npm exposes a bunch of variables to
// the environment prefixed with npm_config_*, npm_package_* and npm_lifecycle_*.
// Here's a list of all variables exposed in my setup.
npm_config_access=
npm_config_allow_same_version=
npm_config_also=
npm_config_always_auth=
npm_config_argv='{"remain":[],"cooked":["run","foo"],"original":["run","foo"]}'
npm_config_auth_type=legacy