Skip to content

Instantly share code, notes, and snippets.

View danikaze's full-sized avatar

danikaze danikaze

  • Tokyo, Japan
View GitHub Profile
/*
* Just execute this after searching for a package in xdcc.horriblesubs.info to get all the
* XDCC commands to get files in IRC, based on the current search
*/
(function() {
const ALTERNATE_BOTS = true;
const hasOwnProperty = Object.prototype.hasOwnProperty;
function xdcc(showFileName) {
@danikaze
danikaze / twitter-bulk-follow.js
Created September 16, 2017 10:11
Follows everyone's followers
/*
* To be executed in the followers page of somebody.
*
*/
(function() {
// time between clicks
var TW_CLICK_DELAY = 1000;
// time between scrolls
var TW_SCROLL_DELAY = 100;
// how many people follow in this batch
@danikaze
danikaze / .bash_profile
Last active November 21, 2018 02:59
Photo backup rsync
alias backup='sudo rsync --update --delete --recursive --progress --perms'
alias backup-premiere='backup --exclude="Adobe Premiere Pro Auto-Save" --exclude="Adobe Premiere Pro Preview Files"'
# Fotografia Y:
alias sync-y='sudo sync-fotos-viejas && sync-ps-res && sync-fotos2008 && sync-fotos2009 && sync-fotos2010 && sync-fotos2011 && sync-fotos2012 && sync-music && sync-webs'
alias sync-fotos2008='backup /mnt/g/Fotografia/2008/ /mnt/y/Fotografia/2008/'
alias sync-fotos2009='backup /mnt/g/Fotografia/2009/ /mnt/y/Fotografia/2009/'
alias sync-fotos2010='backup /mnt/g/Fotografia/2010/ /mnt/y/Fotografia/2010/'
alias sync-fotos2011='backup /mnt/g/Fotografia/2011/ /mnt/y/Fotografia/2011/'
alias sync-fotos2012='backup /mnt/g/Fotografia/2012/ /mnt/y/Fotografia/2012/'
@danikaze
danikaze / steam-summer-saliens.js
Last active June 28, 2018 04:00
Steam summerSaliens auto player
/**
* https://steamcommunity.com/saliengame/play/
* 1. Choose the planet you have interest in.
* 2. Run this code in the browser console to have methods available in `window.salienGame`
* 3. Then just run `salienGame.start()` to farm or `salienGame.stop()` ... to stop ;)
* 4. You can also run `salienGame.stopAfterFight = true;` to schedule a stop after the fight
*/
(function() {
const AUTOFIRE_DELAY = { 0: 250, 1: 500, 2: 400, 3: 250 };
const MONSTER_ATTACK_DELAY = 1000;
@danikaze
danikaze / fix-photo-dates.md
Last active October 27, 2019 05:10
How to fix dates in photo files

Fixing times

Need exiftool

Imagine you live in Tokyo and go to Hong Kong, but forget to change the time in the camera (HK is -1h relative to Tokyo). All your photos would say they were taken one hour before they actually were.

To add one hour to the time fields (DateTimeOriginal, CreateDate and ModifyDate) of all the photos in a folder, just run:

@danikaze
danikaze / .bash_profile
Last active November 21, 2018 03:01
Download MP3s from youtube | requires youtube-dl (https://rg3.github.io/youtube-dl/)
# Download a complete youtube playlist like
# ymp3list START_VIDEO_INDEX PLAYLIST_URL
alias ymp3list="youtube-dl.exe -o \"%(title)s.%(ext)s\" --extract-audio --audio-quality 0 --audio-format mp3 --playlist-start $1 $2"
# Download a single video
# mp3dl VIDEO_URL
alias mp3dl="youtube-dl.exe -o \"%(title)s.%(ext)s\" --extract-audio --audio-quality 0 --audio-format mp3 $1"
@danikaze
danikaze / repoc-show-photos-again.user.js
Created December 18, 2018 09:03
TamperMonkey script to show again profile photos in REPOC SuccessFactors
// ==UserScript==
// @name REPOC SuccessFactors Show photo again
// @namespace http://tampermonkey.net/
// @version 0.1.0
// @description Latest version of Success Factors REPOC hides the photo in the profile page. This script shows it again.
// @author danikaze
// @match https://performancemanager10.successfactors.com/xi/ui/pages/empfile/*
// @grant none
// ==/UserScript==
(function() {
@danikaze
danikaze / rakuten-lottery.user.js
Created December 21, 2018 01:51
Automagically join the Rakuten lottery every day
// ==UserScript==
// @name Rakuten Lottery
// @namespace http://tampermonkey.net/
// @version 0.1.0
// @description Automagically join the Rakuten lottery every day
// @author danikaze
// @homepage https://gist.github.com/danikaze/
// @match *://*/*
// @grant GM_setValue
// @grant GM_getValue
@danikaze
danikaze / wordpress-backup.sh
Created May 8, 2019 08:26
Backup a wordpress database and/or filesystem into one (or two) compressed files based on the input options
#!/usr/bin/env bash
#
# Wordpress site backup
#
# Backup a wordpress database and/or filesystem into one (or two)
# compressed files based on the input options
#
# Author: @danikaze <[email protected]>
#
/**
* Find the route to access `data` in `object`.
* Note that if there's more than one ocurrence of `data` in `object`,
* it will return an array of routes with all of them unless `onlyFirst` is
* `true`, in which case it will just a string with the first found route
* (or `undefined` if not found)
*
* @param object Object where to search for `data`
* @param data Data to find
* @param onlyFirst set to `true` to return after the first match