Skip to content

Instantly share code, notes, and snippets.

View maitrungduc1410's full-sized avatar
💪
Keep chasing your dreams!

Duc Trung Mai maitrungduc1410

💪
Keep chasing your dreams!
View GitHub Profile
@wooooodward
wooooodward / axios.js
Created November 6, 2019 17:16
Axios plugin example with request interceptor that adds JWT token to the auth header and 401 response interceptor to refresh token
import Vue from 'vue'
import axios from 'axios'
import store from '../store'
import { TokenService } from '../services/storage.service'
// Full config: https://github.com/axios/axios#request-config
let config = {
baseURL:
process.env.baseURL ||
@giehlman
giehlman / updateSonarProps.sh
Created February 20, 2018 16:36
Update SonarQube properties file with project name and version from package.json
#!/usr/bin/env bash
#title : updateSonarProps.sh
#description :
# This script parses the project's name and version from its package.json and automagically
# updates the version and package name in the SonarQube configuration properties file.
# It can be used as a pre step before running the sonar-scanner command
# It also creates a backup of the props file with suffix *.bak
#prerequisites : NodeJS based project with package.json, sonar*.properties file in the cwd
#author : Christian-André Giehl <christian@emailbrief.de>
#date : 20180220
@velopert
velopert / CounterManager.m
Created April 25, 2021 11:26
React Native iOS Native Component with Swift
#import <React/RCTViewManager.h>
@interface RCT_EXTERN_MODULE(CounterManager, RCTViewManager)
RCT_EXPORT_VIEW_PROPERTY(value, NSNumber)
RCT_EXPORT_VIEW_PROPERTY(leftButtonText, NSString)
RCT_EXPORT_VIEW_PROPERTY(rightButtonText, NSString)
RCT_EXPORT_VIEW_PROPERTY(onPressLeftButton, RCTDirectEventBlock)
RCT_EXPORT_VIEW_PROPERTY(onPressRightButton, RCTDirectEventBlock)
@aamishbaloch
aamishbaloch / remove_server_details.md
Last active February 13, 2024 14:18
Remove Server Details from Response Header - Nginx

Remove Server Details from Response Header - Nginx

Below mentioned method is used to hide or remove the NGIX details from the header of your http requests.

Install Nginx Extras

sudo apt-get update
sudo apt-get install nginx-extras

Remove Server Details

@d-demirci
d-demirci / keycloak.yml
Created September 15, 2020 18:29
keycloak tutor openedx plugin
name: keycloak
version: 0.1.0
patches:
common-env-features: |
"ENABLE_THIRD_PARTY_AUTH": true
openedx-lms-common-settings: |
SOCIAL_AUTH_KEYCLOAK_KEY = 'educasual'
SOCIAL_AUTH_KEYCLOAK_SECRET = '7c81d36a-bec9-4833-931c-64baab674283'
SOCIAL_AUTH_KEYCLOAK_PUBLIC_KEY = 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjyq0SjRVvMaoHDeB4AcyBmWNNLe36ibopb/8cgXwPIPtphX50MepMK5Xmne1euS6I8ZWPGJl3DNtK215AMUKoy87BSJX5o26RQx8d0M+WTvnw6EVLaskeJSiXu4WkYka2Ou+cc6mkyMMtDnkFybbjFFFdMOkDPSyCMEfakHH2b/es+6KBkIC+yqmigDy/S26rsVX5A7kFUP7QUGBPJqwOVQjyd9JaebQlxwN300NlWme2wZrypXOxWraPmpMsWlZVEtniqO+gtOT+ko41VQospwrsJSfSX05ch25WNIsDhOPNhfYOpdFDviHEiXMjtMm+XTLr0qfzVDdYEyJnmG7XwIDAQAB'
SOCIAL_AUTH_KEYCLOAK_AUTHORIZATION_URL = 'http://keycloak.nubidus.com/auth/realms/openedx/protocol/openid-connect/auth'
@eunsukimme
eunsukimme / Dockerfile.app
Last active March 7, 2024 09:29
Configuration Files for Logging System wigh Docker-elk, Filebeat and Node.js
FROM node:12
WORKDIR /app
COPY ./package*.json ./
RUN npm install
ENV PORT=4000
COPY . .
CMD ["npm","run","start"]
@virolea
virolea / upload.js
Last active March 15, 2024 13:45
Tracking file upload progress using axios
upload(files) {
const config = {
onUploadProgress: function(progressEvent) {
var percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total)
console.log(percentCompleted)
}
}
let data = new FormData()
data.append('file', files[0])
@nileshsimaria
nileshsimaria / docker-default-directory
Last active April 4, 2024 09:13
Change docker's default /var/lib/docker to different directory on Ubuntu
1. Take a backup of docker.service file.
$ cp /lib/systemd/system/docker.service /lib/systemd/system/docker.service.orig
2. Modify /lib/systemd/system/docker.service to tell docker to use our own directory
instead of default /var/lib/docker. In this example, I am using /p/var/lib/docker
Apply below patch.
$ diff -uP -N /lib/systemd/system/docker.service.orig /lib/systemd/system/docker.service
--- /lib/systemd/system/docker.service.orig 2018-12-05 21:24:20.544852391 -0800
@mrbar42
mrbar42 / README.md
Last active April 20, 2024 02:57
bash scripts to create VOD HLS stream with ffmpeg almighty (tested on Linux and OS X)

running:

bash create-vod-hls.sh beach.mkv

will produce:

    beach/
      |- playlist.m3u8
 |- 360p.m3u8
@bennylope
bennylope / ffmpeg-watermark.md
Created April 22, 2016 23:17 — forked from webkader/ffmpeg-watermark.md
FFmpeg add a watermark to video

How to Add a Watermark to Video

FFMPEG filters provide a powerful way to programmatically enhance or alter videos, and it’s fairly simple to add a watermark to a video using the overlay filter. The easiest way to install ffmpeg is to download a pre-built binary for your specific platform. Then you don’t have to worry about including and installing all the right dependencies and codecs you will be using.

Once you have ffmpeg installed, adding a watermark is as easy as passing your existing source through an overlay filter like so:

ffmpeg -i test.mp4 -i watermark.png -filter_complex "overlay=10:10" test1.mp4

Basically, we’re passing in the original video, and an overlay image as inputs, then passing it through the filter, and saving the output as test1.mp4.