Skip to content

Instantly share code, notes, and snippets.

View blackhalt's full-sized avatar
🎯
Focusing

BlackHalt blackhalt

🎯
Focusing
View GitHub Profile
@blackhalt
blackhalt / unfollow-non-followers-twitter.js
Created March 9, 2020 17:17 — forked from jalbam/unfollow-non-followers-twitter.js
Code to stop following those ones who are not following you back on Twitter and keeping those you want or follow anyone you want, with certain filters (working in July 2019)
/*
Unfollow (stop following) those people who are not following you back on Twitter (or unfollow everyone if desired).
This will work for new Twitter web site code structure (it was changed from July 2019, causing other unfollow-scripts to stop working).
Instructions:
1) The code may need to be modified depending on the language of your Twitter web site:
* For English language web site, no modification needed.
* For Spanish language web site, remember to set the 'LANGUAGE' variable to "ES".
* For another language, remember to set the 'LANGUAGE' variable to that language and modify the 'WORDS' object to add the words in that language.
javascript:function sleep(milliseconds){var start = new Date().getTime();for (var i = 0; i < 1e7; i++) {if ((new Date().getTime() - start) > milliseconds){break;}}};e=document.querySelectorAll('input[alt="Follow"]');for(i=0;i<21;i++){e[i].click();sleep(1000);}void(0);
@blackhalt
blackhalt / random_gif.sh
Created October 28, 2019 15:03
random_gif.sh
#!/bin/bash
convert -size 512x512 xc: +noise Random random.png
name="$(date +%s)"
for i in `seq 0 10 359`; do
j=`expr $i \* 5`
convert random.png -channel G \
-function Sinusoid 1,${i} \
-virtual-pixel tile -blur 0x40 -auto-level \
#!/bin/sh
IN="$1"
filename=$(basename "${IN}")
filename="${filename%.*}"
PAGES=$(pdfinfo "$IN" | grep ^Pages: | tr -dc '0-9')
non_blank() {
for i in $(seq 1 $PAGES)
do
PERCENT=$(gs -o - -dFirstPage=${i} -dLastPage=${i} -sDEVICE=inkcov "$IN" | grep CMYK | nawk 'BEGIN { sum=0; } {sum += $1 + $2 + $3 + $4;} END { printf "%.5f\n", sum } ')
@blackhalt
blackhalt / Tid.js
Created March 7, 2019 10:21
Twitter bookmarklet
javascript:e=document.querySelector("div.ProfileNav[data-user-id]");f=e.dataset.userId;void(open("https://twitter.com/intent/user?user_id="+f))
@blackhalt
blackhalt / bildes.js
Created February 22, 2019 17:02
Attēlu savācēju Bookmarkleti
// Tvitera galeriju bilžu savacejs:
javascript:e=document.querySelector("div.Gallery-media > img[src]");f=e.src;void(open(f))
// LSM bilžu savacējs:
javascript:var img = document.querySelector("div.slick-active > figure"),style = img.currentStyle || window.getComputedStyle(img, false),bi = style.backgroundImage.slice(4, -1).replace(/"/g, "");void(open(bi))
@blackhalt
blackhalt / video_th.sh
Last active February 10, 2019 23:41
Video Thumbnail Renew
#!/bin/bash
#For Nemo, Nautilus actions: Exec=/blabla/video_th.sh '%P/%f'
# Ar specsimboliem neJiet :/
# gg=$(echo -n "$aa" | iconv -f UTF8 -t ASCII//TRANSLIT | tr ' ' '_')
fn=$(echo -n "file://`readlink -f $1`" | md5sum | awk '{print $1}')
find $HOME/.cache/thumbnails/ -name "$fn." -exec rm {} \;
ffmpegthumbnailer -s 128 -i "$1" -o $HOME/.cache/thumbnails/normal/"$fn".png -c png -t 10
@blackhalt
blackhalt / Recipe.git
Created January 3, 2019 03:34 — forked from aferrero2707/Recipe.git
AppImage recipe for building GIMP from git
#! /bin/bash
FULL_BUNDLING=0
UPDATE=1
REBUILD=1
PREFIX=/zzz
# Move blacklisted files to a special folder
move_blacklisted()
@blackhalt
blackhalt / ffmpeg.md
Created April 15, 2018 19:10 — forked from protrolium/ffmpeg.md
using ffmpeg to extract audio from video files

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:

@blackhalt
blackhalt / userContent.css
Last active November 18, 2017 04:18
newtab platāka lapa (man ir tikai tikai Top sites)
/*profils/chrome/userContent.css*/
/* Jāņem verā:
browser.newtabpage.columns
browser.newtabpage.rows
Jā, un browser.newtabpage.activity-stream.topSitesCount
*/
@-moz-document url("about:newtab") {