Skip to content

Instantly share code, notes, and snippets.

@ahurov
ahurov / Time Machine On JuiceFS.md
Created March 10, 2023 04:49 — forked from yujunz/Time Machine On JuiceFS.md
Time machine on JuiceFS
JFS_BASE=/Users/yujunz/JuiceFS
JFS_NAME=rogerz-s3-cn-east-1-qiniu
BUNDLE=TimeMachine.sparsebundle
VOLUME=/Volumes/TimeMachine

# Mount JuiceFS
juicefs mount --cache-dir $JUICEFS_BASE/cache --batch 10 --writeback --metacache --opencache $JFS_NAME $JFS_BASE/$JFS_NAME

# Create sparse bundle
@ahurov
ahurov / gh-deploy-clone.sh
Created January 24, 2021 18:48 — forked from blvz/gh-deploy-clone.sh
Creates a deploy key and clones the repository.
#!/usr/bin/env bash
read -r -d '' usage << EOM
Usage:
gh-deploy-clone user/repo [ENVIRONMENT]
EOM
[ -z "$1" ] && echo && echo "$usage" && echo && exit 1
{
"5694": 2164,
"184945": 1028,
"185011": 2165,
"185028": 800,
"198432": 2166,
"200180": 1029,
"440221": 662,
"993598": 774,
"1048782": 2167,
@ahurov
ahurov / GoogleDriveServiceProvider.php
Created October 19, 2019 21:43 — forked from sergomet/GoogleDriveServiceProvider.php
Setup a Laravel Storage driver with Google Drive API
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class GoogleDriveServiceProvider extends ServiceProvider
{
/**
* Bootstrap the application services.
<?php
namespace App\Observers;
use Illuminate\Database\Eloquent\Model;
class RedirectObserver
{
const REDIRECTS = [
\Modules\Shop\Entities\Product::class => [
@ahurov
ahurov / app\Parsers\DentalinfoComUaParser.php
Created October 15, 2018 11:02
Мониторинг цен конкурентов (парсит сайты конкурентов)
<?php
namespace App\Parsers;
class DentalinfoComUaParser extends Parser {
use SearchResultsOnlyLinks;
protected $searchUrlTemplate = 'http://dentalinfo.com.ua/site/search?q={search}';
// смысл селекторов отличается из-за SearchResultsOnlyLinks
@ahurov
ahurov / Caddyfile
Created October 5, 2018 21:22 — forked from electerious/Caddyfile
Most complete list of mime types in the correct format for the Caddy mime directive
mime {
.atom application/atom+xml
.json application/json
.map application/json
.topojson application/json
.jsonld application/ld+json
.rss application/rss+xml
.geojson application/vnd.geo+json
.rdf application/xml
.xml application/xml
@ahurov
ahurov / delete_git_submodule.md
Created October 4, 2018 20:13 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule