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 | |
# requires: brew install tag | |
# you can change the source, for me the script is run by my Mac Mini server which only has to tag iCloud Drive documents | |
source="$HOME/Library/Mobile Documents/com~apple~CloudDocs" | |
# delete all tags once per day to clean up (if a project doesn't fit anymore) | |
if [ `date +"%H"` = 0 ]; then | |
tags=( "Git" "Node" "React" "VueJS" ) |
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
<?php | |
$settings = []; | |
// svg file | |
if (isset($_GET['svg'])) { | |
// general/custom svg file | |
$svgFile = DIR_ASSETS.'/cdn/dist/svg/'.$_GET['svg']; | |
if (!preg_match('~^\w[\w/-]+\.svg$~', $_GET['svg']) || !file_exists($svgFile)) die('Invalid svg'); | |
} elseif (isset($_GET['fa'])) { | |
// fontawesome icon |
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
<?php | |
// @author: su.at (made for myself) | |
class Hue { | |
private static $ip = '___ADD-HUE-IP-ADDRESS-HERE___'; | |
private static $user = '___ADD-USER-ID-HERE___'; | |
// private methods | |
private static function request($method, $api, $body) { | |
$url = self::$user.'/'.$api; | |
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
Show hidden characters
{ | |
"env": { | |
"browser": true | |
}, | |
"parserOptions": { | |
"ecmaVersion": 5 | |
}, | |
"rules": { | |
"no-undef": 0, | |
"no-cond-assign": [ |
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
<?php | |
/** | |
* Example output: | |
* function: file_exists(__FILE__); | |
* time: 1.39806 seconds | |
* speed: 39.248 % | |
* | |
* function: is_file(__FILE__); | |
* time: 0.3417 seconds | |
* speed: 85.152 % |
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
# you will need https://github.com/jdberry/tag for finder tags (and correct the path) | |
{ | |
grep -rlIi --null -E -e "(\#|//|/\*\*?)\s*todo\b" --exclude-dir="Library" --exclude-dir="node_modules" --include=\*.{php,js,css,htm,html} "$HOME" | xargs -0 .../execs/tag -a "ToDo" | |
} &> /dev/null |
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 | |
# requires 'tag' binary from https://github.com/jdberry/tag | |
# auto git tag | |
{ | |
find $HOME -type d \ | |
! -path '*Trash' \ | |
-name ".git" -exec dirname {} \; | while read line; do \ | |
./tag -a Git "$line"; done |
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
<?php | |
sd('./', parseFile); | |
/** | |
* recursive scandir | |
*/ | |
function sd($d, $cb) { | |
$s = scandir($d); | |
foreach ($s as $f) { | |
if ($f[0] == '.') continue; |
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
/** | |
* Permanenty delete some Google Drive files from the trash. | |
*/ | |
function run() { | |
var trashed = DriveApp.getTrashedFiles(); | |
while (trashed.hasNext()) { | |
parseTrashedFile(trashed.next()); | |
} | |
} |
NewerOlder