Skip to content

Instantly share code, notes, and snippets.

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

Can Ngo ngocongcan

🏠
Working from home
  • Da nang, Vietname
View GitHub Profile

Change screenshot folder

defaults write com.apple.screencapture location /path/
killall SystemUIServer
xcode-select --install
# Install dependencies
brew install wget autoconf openssl libjpeg libpng lzlib curl imap-uw readline postgresql libxml2 mcrypt gettext libxslt homebrew/dupes/libiconv icu4c expat bison webp freetype
# Dirs
mkdir -p /Applications/MAMP/bin/php/php7.1.12/include
cd /Applications/MAMP/bin/php/php7.1.12/include
# Download PHP 7.1.12 sources
@ECHO OFF
Setlocal EnableDelayedExpansion
set INPUT=C:\Users\Administrator\Desktop\ffmpeg-20180410-d64183e-win64-static\ffmpeg-20180410-d64183e-win64-static\bin\A1
set OUTPUT=C:\Users\Administrator\Desktop\ffmpeg-20180410-d64183e-win64-static\ffmpeg-20180410-d64183e-win64-static\bin\A2
: encode video
for %%i in ("input\*.mp4") DO ffmpeg -i "%%i" -ss 00:00:05 -to 00:12:57 -c copy "output/%%~ni.mp4"
pause
REM -i: This specifies the input file. In that case, it is (input.mp4).
REM -ss: Used with -i, this seeks in the input file (input.mp4) to position.
for %%i in ("output\*.mp4") DO ffmpeg -i "%%i" -i watermark.png -filter_complex "overlay=1110:85" -pix_fmt yuv420p -c:a copy "%%~ni.mp4"
pause
:: ffmpeg -i input.mp4 -i image.png \
::-filter_complex "[0:v][1:v] overlay=25:25:enable='between(t,0,20)'" \
::-pix_fmt yuv420p -c:a copy \
::output.mp4
DROP FUNCTION IF EXISTS fn_remove_accents;
DELIMITER |
CREATE FUNCTION fn_remove_accents( textvalue VARCHAR(10000) ) RETURNS VARCHAR(10000)
BEGIN
SET @textvalue = textvalue;
-- ACCENTS
SET @withaccents = 'ŠšŽžÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÑÒÓÔÕÖØÙÚÛÜÝŸÞàáâãäåæçèéêëìíîïñòóôõöøùúûüýÿþƒàáạảãâầấậẩẫăằắặẳẵèéẹẻẽêềếệểễìíịỉĩòóọỏõôồốộổỗơờớợởỡùúụủũưừứựửữỳýỵỷỹđÀÁẠẢÃÂẦẤẬẨẪĂẰẮẶẲẴÈÉẸẺẼÊỀẾỆỂỄÌÍỊỈĨÒÓỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠÙÚỤỦŨƯỪỨỰỬỮỲÝỴỶỸĐ';
sudo initctl list |grep rabbit
rabbitmq-notif start/running, process 18499
rabbitmq-rest-api-batch start/running, process 18526
rabbitmq-synch start/running, process 18490
rabbitmq-user_data start/running, process 18546
rabbitmq-rest-api-batch-mail start/running, process 18537
rabbitmq-threaded-rest-api-batch stop/waiting
rabbitmq-legacy-importer start/running, process 18516
rabbitmq-img start/running, process 18479
public function massDownloadAction(Request $request) {
$documentids = $request->get('documentids', []);
$dir = $this->container->getParameter('documents_dir');
$repo = $this->getDoctrine()->getManager()->getRepository(Documents::class);
// Create new Zip Archive.
$zip = new \ZipArchive();
$now = date("Y-m-d H-i-s");
$zipName = 'Documents-' . $now . '.zip' ;
$zip->open($zipName, \ZipArchive::CREATE);
foreach ($documentids as $id) {
<html>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script>
$(document).ready(function (){
$("#click").click(function (){
$('html, body').animate({
scrollTop: $("#div1").offset().top
}, 2000);
});
});
@ngocongcan
ngocongcan / valet.conf
Created April 13, 2020 15:02 — forked from poul-kg/valet.conf
CORS Rules for Laravel Valet Nginx
# To enable CORS you should add lines with CORS rules below to your valet.conf file
# Find the file /usr/local/etc/nginx/valet/valet.conf - this is Valet conf for Nginx
# of try to execute `locate valet.conf` and find the `valet.coinf` in `nginx` subdirectory
# after you edit your valet.conf do not forget to execute `valet restart`
server {
listen 80 default_server;
root /;
charset utf-8;
client_max_body_size 128M;
https://sourabhbajaj.com/mac-setup/iTerm/tree.html