Skip to content

Instantly share code, notes, and snippets.

View sueharaluke's full-sized avatar

Lucas Suehara Emilio sueharaluke

  • Tokyo, Japan
View GitHub Profile
@sueharaluke
sueharaluke / delete_ds_store.txt
Created October 6, 2017 07:17
Delete .DS_Store from terminal
find / -name "削除したいファイル" -print -exec rm -rf {} ";"
例:
find / -name ".DS_Store" -print -exec rm -rf {} ";"
@sueharaluke
sueharaluke / virtualenvOnWindowsGitBash.txt
Created May 12, 2018 12:02
How to activate virtualenv in windows git bash.
Just copy the two files in this folder -> \Python34\Lib\venv\scripts\posix
And paste them here -> \Python34\Lib\venv\scripts\nt
Now you can activate it with Git Bash on Windows.
$ source ./Scripts/activate
@sueharaluke
sueharaluke / delete_drive_icon.txt
Created July 26, 2018 07:37
Find and delete all Google Drive icon files
find . -name 'Icon*' -type f -delete
@sueharaluke
sueharaluke / header.php
Created November 4, 2018 07:04
Add timestamp to css/js after update
<?php
$cssfile = '/styles.css'
?>
<link rel="stylesheet" href="<?php echo $cssfile.'?v='.filemtime($_SERVER['DOCUMENT_ROOT'].$cssfile);?>" />
<!--
If you prefer a full date
-->
<link rel="stylesheet" href="<?php echo $cssfile.'?v='.date'Ymd', filemtime($_SERVER['DOCUMENT_ROOT'].$cssfile));?>" />
@sueharaluke
sueharaluke / batch_update_files_to_utf8.txt
Last active August 18, 2021 06:23
Batch update encoding (ubuntu)
// Install nkf
$ sudo apt install nkf
// Batch update all .html files inside current directory
// To UTF-8
$ find . -type f -name "*.html" -exec nkf -w --overwrite {} \;
// To SHIFT_JIS 半角が全角になる
@sueharaluke
sueharaluke / page.php
Last active January 5, 2021 09:39
Organize wordpress pages files in folders
<?php
/*
This is by no means an elegant solution. (Maybe someone can elegantly loop it.)
With this page.php in place, you can store your custom template pages inside folders.
ie.:
/company/ -> pages/page-company.php
/company/about/ -> pages/page-about.php
/company/about/partners/ -> pages/about/page-partners.php
Better them storing them flatly inside the theme folder.
@sueharaluke
sueharaluke / zip_changes.md
Last active November 16, 2021 07:26
Zip files changes between commits

Zip files changes between commits

It also ignores delete files.

Only the latest commit

git archive --format=zip HEAD `git diff --diff-filter=d HEAD^ HEAD --name-only` > diff.zip

Between two SHA

@sueharaluke
sueharaluke / appswitcher-all-displays.md
Created May 20, 2022 00:51
MacOS Cmd+Tab show icons on all monitors
@sueharaluke
sueharaluke / text.md
Created February 3, 2024 00:18
Convert video to mp4 or webm using ffmpeg

Convert to mp4

ffmpeg -i original.mp4 -vcodec libx264 -crf 24 converted.mp4

ffmpeg -i original.mov -vcodec libx264 -crf 24 converted.mp4

Convert to webm

ffmpeg -i original.mp4 -vcodec libvpx -qmin 0 -qmax 50 -crf 10 -b:v 1M converted.webm