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
/** | |
* Example of simulating file upload post form from node.js | |
* | |
* Set your own file and server options. | |
*/ | |
var img = require('fs').readFileSync('./sample.png'); | |
var options = { host: '...' | |
, port: ... |
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
/* custom-reset.css | 20.08.2018 | https://yurch-html.github.io/dist/custom-reset.html */ | |
*, | |
*:before, | |
*:after { | |
box-sizing: inherit; | |
} | |
html { | |
box-sizing: border-box; |
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
db.getCollection('fs.chunks').aggregate([ | |
{ $lookup: { from: 'fs.files', localField: 'files_id', foreignField: '_id', as: 'file' } }, | |
{ $unwind: { path:'$file', preserveNullAndEmptyArrays: true } }, | |
{ $match: { file: { $exists: false } } }, | |
{ $project: { _id: 1, files_id: 1 } }, | |
]).forEach(function(chunk) { | |
printjson(chunk); | |
// db.getCollection('fs.chunks').remove({ _id: chunk._id }); | |
}); |
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
/* | |
* Date Format 1.2.3 | |
* (c) 2007-2009 Steven Levithan <stevenlevithan.com> | |
* MIT license | |
* | |
* Includes enhancements by Scott Trenda <scott.trenda.net> | |
* and Kris Kowal <cixar.com/~kris.kowal/> | |
* | |
* Accepts a date, a mask, or a date and a mask. | |
* Returns a formatted version of the given date. |
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
const classNames = (...args) => args.reduce((list, clss) => list.concat(clss).filter(Boolean), []) | |
.join(' ').trim().replace(/\s{2,}/g, ' '); | |
const test = null; | |
const test2 = true; | |
console.log(classNames(test && 'test1')); | |
console.log(classNames(test2 && 'test2')); | |
console.log(classNames(['test1', 'test2', test && 'test3', test2 && 'test4'], 'test5')); |
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
##### PS1 ####### | |
autoload -U colors && colors | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
check_node() { | |
diff <(node -v 2> /dev/null) <(cat .nvmrc 2> /dev/null)| sed -e "/^[^>*]/d" -e 's/>.* \(.*\)/ (\1)/' | |
} |
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
// Wifi Credentials | |
const WIFI_NAME = "YOURSSID"; | |
const WIFI_PASS = "YOURPASS"; | |
// Your location latitude and longitude | |
const lat = 'YOURLAT'; | |
const lon = 'YOURLON'; | |
// Required libs |
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
# Serve nextJS app from a port through NGINX reverse proxy (HTTP) | |
# Path: /etc/nginx/sites-available/default | |
# Default server configuration for HTTP | |
server { | |
server_name www.DOMAINNAME.com DOMAINNAME.com; | |
# Serve any static assets with NGINX | |
location /_next/static { | |
alias /home/ubuntu/PROJECT_FOLDER/.next/static; |
OlderNewer