Skip to content

Instantly share code, notes, and snippets.

@coodix
coodix / yam_urls_removal.js
Created September 3, 2016 12:27
Yandex Webmaster mass URLs removal
setInterval(function() {
var e = urls.pop();
if (e) {
console.log(e);
$('#uniq1472745500789286316').val(e);
$('button[type=submit]').click();
}
}, 3000);
var urls = ["http://cleanstore.ru/shopping_cart?product_id=222",
@coodix
coodix / sitemap-crawler.php
Created February 7, 2017 13:07 — forked from bjornjohansen/sitemap-crawler.php
Basic sitemap crawler to warm up a full page cache
#!/usr/bin/php
<?php
date_default_timezone_set( 'UTC' );
$sitemaps = array(
'https://bjornjohansen.no/sitemap_index.xml',
);
@coodix
coodix / PersistenceCollectionCrawlQueue.php
Created March 23, 2018 07:09
PersistenceCollectionCrawlQueue
<?php
class PersistenceCollectionCrawlQueue extends \Spatie\Crawler\CrawlQueue\CollectionCrawlQueue
{
protected $last_saved_time;
protected function flushQueueOnDisk()
{
if (!$this->last_saved_time || time() - $this->last_saved_time > 60) {
$this->last_saved_time = time();
@coodix
coodix / XOAUTH2 Gmail api smtp notes.txt
Created May 23, 2018 07:09
XOAUTH2 Gmail api smtp notes
https://developers.google.com/api-client-library/ruby/auth/service-accounts?hl=ru
https://cloud.google.com/docs/authentication/production?hl=ru#auth-cloud-explicit-ruby
https://github.com/francois-blanchard/human_relationship_manager/blob/5a672f9b6e1d7b17c6884705332c170ca7c5e95a/app/services/google_client.rb
https://github.com/cunhasb/sms-manager-backend/blob/13ce7b627fb7217caf411691e377e600fe597b92/app/controllers/api/v1/auth_controller.rb
https://github.com/chriskoz/QueueProxy/blob/ed7dff392775e8069d2d0a49eb02c9266bef9df3/app/controllers/queue_controller.rb
@coodix
coodix / gist:cea1e756bffb6ae86390f841578fe5d4
Created September 20, 2018 09:21
Backup-restore / move docker volume
docker run --rm -v /tmp:/backup -v webproxy_letsencrypt_data:/webproxy_letsencrypt_data busybox tar cvf /backup/backup.tar /webproxy_letsencrypt_data/
dm scp dustbag:/tmp/backup.tar dustbag.vs:/tmp/backup.tar
docker run --rm -v /tmp:/backup -v webproxy_letsencrypt_data:/webproxy_letsencrypt_data busybox sh -c "cd /webproxy_letsencrypt_data && tar xvf /backup/backup.tar --strip-components=1"
docker run -it --rm -v /tmp:/backup -v webproxy_letsencrypt_data:/webproxy_letsencrypt_data busybox sh
@coodix
coodix / ide_show_git_diff_ide_scripting.kt
Created December 13, 2019 08:18
Ide script for showing git diff dialog between any two commits
import com.intellij.vcsUtil.VcsUtil
import git4idea.GitUtil
import git4idea.GitContentRevision
import git4idea.GitRevisionNumber
import com.intellij.openapi.vcs.history.VcsDiffUtil
import git4idea.changes.GitChangeUtils
import git4idea.history.GitHistoryUtils
import com.intellij.openapi.actionSystem.CommonDataKeys
import com.intellij.ide.DataManager
import com.intellij.dvcs.DvcsUtil
@coodix
coodix / gist:4fc9e68eef869e183cd42c662b7a6050
Created September 24, 2020 11:08
1password op cli load keys to ssh agent
op list items --tags ssh | op get item - --fields title | parallel -l 1 'op get item {} --fields notesPlain | ssh-add -'