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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| /** | |
| * @ngdoc directive | |
| * @name myapp.directive:forceLowerCase | |
| * @description | |
| * # forceLowerCase | |
| */ | |
| angular.module('myApp').directive('forceLowerCase', [ | |
| '$parse', |
Another big ol' list of React resources
Tutorials
- https://medium.com/@firasd/quick-start-tutorial-using-redux-in-react-apps-89b142d6c5c1
- https://github.com/firasd/react-redux-tutorial
- https://github.com/reactjs/react-redux
- http://www.youhavetolearncomputers.com/blog/2015/9/15/a-conceptual-overview-of-redux-or-how-i-fell-in-love-with-a-javascript-state-container
React redux project structure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var nextLink; | |
| function open_page(url) { | |
| console.log("Opening " + url); | |
| osmosis.get(url) | |
| .find('#nav td:last a') | |
| .set({ | |
| 'nextLink': '@href' | |
| }) | |
| .find('.g') | |
| .set({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 \ |
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()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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 |