Skip to content

Instantly share code, notes, and snippets.

View harrytran998's full-sized avatar
💎
Build right things what matters!

Harry Tran harrytran998

💎
Build right things what matters!
View GitHub Profile
import * as Sentry from "@sentry/node";
import imagemin from "imagemin";
import mozjpeg from "imagemin-mozjpeg";
import sharp from "sharp";
import isJpg from "is-jpg";
import * as aws from "aws-sdk";
import { Upload } from "../../types/graphqlUtils";
import { generateFilename } from "./generateFilename";
export const s3 = new aws.S3({
@harrytran998
harrytran998 / Extension.json
Last active February 25, 2020 07:04
Below is my config files in Visual Studio Code. Enjoy !!!!
[
{
"metadata": {
"id": "f583eafd-aa0d-4ccb-8f44-d1e610389660",
"publisherId": "CoenraadS.bracket-pair-colorizer",
"publisherDisplayName": "CoenraadS"
},
"name": "bracket-pair-colorizer",
"publisher": "CoenraadS",
"version": "1.0.61"
@harrytran998
harrytran998 / boostrap-vue.js
Last active January 13, 2020 16:56
Store the plugin of vueJS
import Vue from 'vue'
import {
LayoutPlugin,
BCard,
BCardBody,
BCardTitle,
BCardText,
BCardGroup,
BButton,
} from 'bootstrap-vue'
@harrytran998
harrytran998 / 📊 Weekly development breakdown
Last active September 23, 2020 01:16
Weekly coding breakdown 🥳
Vue.js 19 hrs 15 mins ████████████▏░░░░░░░░ 58.2%
JSON 5 hrs 36 mins ███▌░░░░░░░░░░░░░░░░░ 16.9%
TypeScript 3 hrs 33 mins ██▎░░░░░░░░░░░░░░░░░░ 10.8%
YAML 1 hr 59 mins █▎░░░░░░░░░░░░░░░░░░░ 6.0%
Other 1 hr 1 min ▋░░░░░░░░░░░░░░░░░░░░ 3.1%
@harrytran998
harrytran998 / PostgresExtention.js
Last active March 2, 2020 11:12
I don't have idea what I do
'use strict'
module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.sequelize.query('CREATE EXTENSION IF NOT EXISTS "uuid-ossp";')
},
down: (queryInterface, Sequelize) => {
return queryInterface.sequelize.query('DROP EXTENSION IF EXISTS "uuid-ossp" RESTRICT;')
},
@harrytran998
harrytran998 / Snippets 👨🏻‍💻 #Productivity
Created March 15, 2020 12:15
All snippets - Back-end - Sequelize
{
"Import Export Default Module": {
"scope": "javascript",
"prefix": "iemp",
"body": [
"import ${1} from './${1}'",
"",
"export default ${1}"
],
@harrytran998
harrytran998 / embedded-file-viewer.md
Created November 1, 2020 03:03 — forked from tzmartin/embedded-file-viewer.md
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links

@harrytran998
harrytran998 / mime.html
Created December 4, 2020 06:58 — forked from topalex/mime.html
How to check real mime type of image in javascript
<html>
<head>
<script type="text/javascript" src="/jquery.min.js"></script>
<title>Mime type checker</title>
<script>
$(function () {
var result = $('div#result');
if (window.FileReader && window.Blob) {
$('span#submit').click(function () {
var files = $('input#file').get(0).files;
@harrytran998
harrytran998 / README.md
Created December 28, 2020 07:48 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

#!/bin/bash
#
# Inspects branch name and checks if it contains a Jira ticket number (i.e. ABC-123).
# If yes, commit message will be automatically prepended with [ABC-123].
#
# Useful for looking through git history and relating a commit or group of commits
# back to a user story.
#