The Gist has turned into: https://github.com/TvrboPro/TvrboBackup
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 Promise = require('bluebird'); | |
| module.exports = function wrap(genFn) { | |
| const promisedFunc = Promise.coroutine(genFn); | |
| return (req, res, next) => { | |
| promisedFunc(req, res, next).catch(next); | |
| } | |
| }; |
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 CACHE_NAME = 'tvrbo-cache'; | |
| var filesToCache = [ | |
| './bundle.js' | |
| ]; | |
| self.addEventListener('install', function(event) { | |
| event.waitUntil(caches.open(CACHE_NAME).then(function(cache) { | |
| return cache.addAll(filesToCache); | |
| })); | |
| }); |
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
| # vim:ft=zsh ts=2 sw=2 sts=2 | |
| # | |
| # agnoster's Theme - https://gist.github.com/3712874 | |
| # A Powerline-inspired theme for ZSH | |
| # | |
| # # README | |
| # | |
| # In order for this theme to render correctly, you will need a | |
| # [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts). | |
| # Make sure you have a recent version: the code points that Powerline |
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
| // These are de default settings | |
| // They may be overriden by the values in cofig-production.js if NODE_ENV=production | |
| // They may also be averriden if an environment variable with the same name is set | |
| // WARNING: Do not include this file directly. Use config.js instead | |
| module.exports = { | |
| DEBUG: true, | |
| COMPONENT_NAME: 'PROJECT API', | |
| HTTP_PORT: 8000, |
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 crypto = require('crypto'); | |
| function digestPwd(password){ | |
| var shasum = crypto.createHash('sha1'); | |
| shasum.update(password); | |
| return shasum.digest('hex'); | |
| } | |
| module.exports = digestPwd; |
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
| # TO DO | |
| # - Replace '9000' with your local port | |
| # | |
| # - Run certbot to geherate a certificate for domain-name.com and uncoment the HTTPS section below | |
| # $ certbot certonly --webroot -w /var/www/certbot -d www.domain-name.com -d domain-name.com | |
| upstream app-server { | |
| ip_hash; | |
| server: localhost:9000; | |
| # server: localhost:9001; # used if clustering is available |
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
| # Extra info: | |
| # https://firebase.google.com/docs/ios/setup | |
| react-native init Twins | |
| cd Twins | |
| react-native run-ios | |
| yarn add react-native-fcm | |
| react-native link react-native-fcm |
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
| app.directive('uploader', ['$http', '$q', 'notification', '$state', function ($http, $q, notification, $state) { | |
| return { | |
| restrict: 'E', | |
| scope: { | |
| prefix: '&', | |
| suffix: '&' | |
| }, | |
| link: function ($scope) { | |
| $scope.uploaded = false; |
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
| // Generate a private key => address from a passphrase | |
| const passphrase = process.argv[2]; | |
| if(!passphrase) { | |
| console.log("Usage: node app 'your-passphrase-here'"); | |
| process.exit(); | |
| } | |
| const EthUtil = require("ethereumjs-util") | |
| const Web3 = require('web3') |