- http://stackoverflow.com/questions/804115 (
rebase
vsmerge
). - https://www.atlassian.com/git/tutorials/merging-vs-rebasing (
rebase
vsmerge
) - https://www.atlassian.com/git/tutorials/undoing-changes/ (
reset
vscheckout
vsrevert
) - http://stackoverflow.com/questions/2221658 (HEAD^ vs HEAD~) (See
git rev-parse
) - http://stackoverflow.com/questions/292357 (
pull
vsfetch
) - http://stackoverflow.com/questions/39651 (
stash
vsbranch
) - http://stackoverflow.com/questions/8358035 (
reset
vscheckout
vsrevert
)
This file contains 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
// Define the type for upload parts | |
type UploadParts = { | |
ETag: string; | |
PartNumber: number; | |
}; | |
// Function to create multipart upload | |
async function createMultipartUpload(file: File): Promise<{ uploadId: string; key: string }> { | |
const fileKey = `${crypto.randomUUID()}-${file.name}`; |
This file has been truncated, but you can view the full file.
This file contains 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
{"nodes":[{"id":1,"callFrame":{"functionName":"(root)","scriptId":"0","url":"","lineNumber":-1,"columnNumber":-1},"hitCount":0,"children":[2,43,380,381,388,666,678,682,691,2493,2496,2505,2507,2509,2513,2514,2552,2554,2568,2711,2720,2722,2799,2805,2881,2899,2918,2919,2923,2925,2946,2948,2976,2996,4836,4908,5999,6387,6418,6423,6437,6468,6490,6794,6849,6854,6855,6888,6898,6900,6901,7321,7416,7420,7426,7444,7455]},{"id":2,"callFrame":{"functionName":"processTicksAndRejections","scriptId":"39","url":"node:internal/process/task_queues","lineNumber":66,"columnNumber":34},"hitCount":6,"children":[3,408,415,2797,2894,2898,2908,2979,2982,3004,3005,4830,6672,6723,7360,8083],"positionTicks":[{"line":69,"ticks":1},{"line":98,"ticks":1},{"line":81,"ticks":1},{"line":82,"ticks":2},{"line":77,"ticks":1}]},{"id":3,"callFrame":{"functionName":"emit","scriptId":"455","url":"node:internal/child_process","lineNumber":934,"columnNumber":15},"hitCount":1,"children":[4,393],"positionTicks":[{"line":936,"ticks":1}]},{"id":4,"callFram |
This file contains 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 : http://country.io/names.json, http://country.io/prefix.json | |
// Make sure to update it once in a while | |
const countries = [ | |
{ name: 'Afghanistan', code: 'AF', prefix: '93' }, | |
{ name: 'Aland Islands', code: 'AX', prefix: '35818' }, | |
{ name: 'Albania', code: 'AL', prefix: '355' }, | |
{ name: 'Algeria', code: 'DZ', prefix: '213' }, | |
{ name: 'American Samoa', code: 'AS', prefix: '1684' }, | |
{ name: 'Andorra', code: 'AD', prefix: '376' }, | |
{ name: 'Angola', code: 'AO', prefix: '244' }, |
This file contains 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 langCodes = [ | |
{name: 'Africans', code: 'afr'}, | |
{name: 'Arabians', code: 'abr'}, | |
{name: 'Chinese', code: 'chi_sim'}, | |
{name: 'Danish', code: 'dan'}, | |
{name: 'Dutch', code: 'nld'}, | |
{name: 'English', code: 'eng'}, | |
{name: 'Finish', code: 'fin'}, | |
{name: 'French', code: 'fra'}, | |
{name: 'Greek', code: 'ell'}, |
This file contains 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
import React from 'react'; | |
function shortId() { | |
// Taken from stackoverflow. I Forget the reference. | |
// I generate the UID from two parts here | |
// to ensure the random number provide enough bits. | |
var firstPart = (Math.random() * 46656) | 0; | |
var secondPart = (Math.random() * 46656) | 0; | |
firstPart = ("000" + firstPart.toString(36)).slice(-3); | |
secondPart = ("000" + secondPart.toString(36)).slice(-3); |
This file contains 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 | |
## SEE: http://pm2.keymetrics.io/docs/tutorials/capistrano-like-deployments | |
# 0. Folder Structure | |
# -> /var/www/project_root | |
# -> source | |
# -> current -> symlink to latest release | |
# -> versions | |
# -> sha-of-commit | |
# -> logs |
This file contains 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
// This version is specially built for used in css-in-js solution. | |
// You can specifically import single colors to take advantage of webpack. For eg: import {red_50} from 'material_colors' | |
// This one consist of flat naming instead of this json based : https://gist.github.com/kawanet/a880c83f06d6baf742e45ac9ac52af96 | |
module.exports = { | |
// red | |
'red_50': '#ffebee', | |
'red_100': '#ffcdd2', | |
'red_200': '#ef9a9a', | |
'red_300': '#e57373', |
References
- http://www.tldp.org/LDP/Bash-Beginners-Guide/html/index.html (Beginner)
- http://www.tldp.org/LDP/abs/html/index.html (Advanced)
- https://gist.github.com/LeCoupa/122b12050f5fb267e75f (Cheatsheet)
### 0. Special Characters (more info: http://tldp.org/LDP/abs/html/special-chars.html)
# This is a comment
This file contains 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 | |
express = require('express'), | |
logger = require('morgan'), | |
path = require('path'), | |
bodyParser = require('body-parser'), | |
serveStatic = express.static, | |
MongoClient = require('mongodb').MongoClient, | |
io = require('socket.io'), | |
http = require('http'); |
NewerOlder