Skip to content

Instantly share code, notes, and snippets.

View kennyki's full-sized avatar
🏠
Working from home

Kenny Ki kennyki

🏠
Working from home
View GitHub Profile
@AllanJeremy
AllanJeremy / FirebaseUploader.js
Last active May 8, 2024 18:15
Firebase extension of Quasar's QUploader component (that performs firebase uploads)
/** This component is now maintained via the [quasar-helpers repo](https://github.com/AllanJeremy/quasar-helpers) */
import { createUploaderComponent } from "quasar";
import { computed, ref, watch } from "vue";
// Firebase stuff
import {
getDownloadURL,
ref as firebaseRef,
uploadBytesResumable,
} from "@firebase/storage";
@rossta
rossta / initializers:hello.js
Last active November 12, 2020 19:45
Webpack with require.context
console.log('initializer hello.js');
@nhnam
nhnam / gist:97a924ad559308bedb58
Created November 7, 2015 05:50 — forked from j3j5/gist:8b3e48ccad746b90a54a
Adyen Test Card Numbers
Adyen Test Card Numbers
These cards are only valid on our TEST system and they will never involve any actual transaction or transfer of funds. The TEST card numbers will not work on the Adyen LIVE Platform.
For all cards use the following expiration and CVV2/CVC2/or CID for Amex.
For all cards:
Expiration Dates CVV2 / CVC3 CID (American Express)
06/2016 OR 08/2018 737 7373
@jkubacki
jkubacki / gist:e2dd904bd648b0bd4554
Created January 21, 2015 18:47
Mac uninstall elasticsearch
#!/usr/bin/env sh
# checks to see if running
launchctl list | grep elasticsearch
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist
launchctl remove homebrew.mxcl.elasticsearch
pkill -f elasticsearch
@Evanion
Evanion / .bowerrc
Last active April 18, 2017 16:14
Revised Ionic build environment
{
"directory": "vendor"
}
@mlms13
mlms13 / Gulpfile.js
Created August 25, 2014 15:32
Deploy ignored, compiled files to Heroku with Gulp
// Use shell commands to commit your ignored, compiled files, push
// everything to Heroku, and reset your commit like it never happened
gulp.task('deploy', ['other', 'compilation', 'tasks'], function () {
var shell = require('shelljs');
if (!shell.which('git')) {
console.error('You need git installed to deploy.');
shell.exit(1);
}
@sheharyarn
sheharyarn / mongo_backup.sh
Last active August 28, 2024 08:18
Mongodump Shell Script for Cronjob
#!/bin/bash
MONGO_DATABASE="your_db_name"
APP_NAME="your_app_name"
MONGO_HOST="127.0.0.1"
MONGO_PORT="27017"
TIMESTAMP=`date +%F-%H%M`
MONGODUMP_PATH="/usr/bin/mongodump"
BACKUPS_DIR="/home/username/backups/$APP_NAME"
@branneman
branneman / better-nodejs-require-paths.md
Last active August 28, 2024 01:17
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@cobyism
cobyism / gh-pages-deploy.md
Last active September 20, 2024 19:25
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).