Skip to content

Instantly share code, notes, and snippets.

View eggplants's full-sized avatar
🏠
Working from home

haruna eggplants

🏠
Working from home
View GitHub Profile
@eggplants
eggplants / setup-tex.sh
Last active April 18, 2022 02:28
texこれだけ in Ubuntu
#!/bin/bash
# compile:
# $ latexmk *.tex
# compile && preview:
# $ latexmk -pv *.tex
# ref:
# https://qiita.com/rainbartown/items/d7718f12d71e688f3573
@eggplants
eggplants / copy_aff_codes.js
Last active November 22, 2021 15:19
https://pub.a8.net/a8v2/media/linkAction.do からtextarea内アフィリエイトバナーコードをJs Object形式で一括コピーするBookmarklet
javascript:var a="";document.querySelectorAll("textarea").forEach(e=>{a+=`\`${e.value}\`,`});window.prompt("ads=[...]とかの中にコピペ",a.replace(/a href/g, 'a target="_blank" href').replace(/border="\d+" width="\d+" height="\d+"/g, `onerror="this.onerror=null;this.src='https://raw.githubusercontent.com/eggplants/ads/master/img/404.png';"`))
@eggplants
eggplants / download_all_scr_greasyfork.sh
Created November 16, 2021 21:22
Download all scripts of a user in GreasyFork
#!/usr/bin/bash
readonly USERPAGEID=671442
if ! command -v awk curl >/dev/null; then
echo "Install: awk, curl">&2
exit 1
fi
curl -sL 'https://greasyfork.org/en/users/'"$USERPAGEID" |
awk -F\" '/class="script-link"/{c=split($4,f,"/")
print$4"/code/"f[c]".user.js" | "xargs -n1 curl -OL"}'
#!/usr/bin/env bash
_enc(){
od -tx1 -An | tr ' ' % | tr -d \\n
}
if ! command -v curl >/dev/null; then
echo "'curl' is not found">&2
exit 1
fi
[ -f "$1" ] || {
#!/usr/bin/env bash
# sudo apt install imagemagick -y
# gem install --user lolcat
# go get -u github.com/jiro4989/textimg
# curl -Lo dtimg https://git.io/J1mJN && sudo install -m+x dtimg /usr/local/bin
eval 'dtimg -F 17 -R '{インターネット\>a,♪即刻やめろ♪\>b}\;
x=`<a wc -l`;y=`<b wc -l`
for i in {0..500..25}
{
@eggplants
eggplants / 1337.rb
Last active November 14, 2021 19:51
カッコは考慮しない `(op3 (op2 (op1 a b) c) d)`を探索
# frozen_string_literal: true
def add (x, y); x + y; end
def sub (x, y); x - y; end
def mul (x, y); x * y; end
def div (x, y); x / y; end
def find_ten (a, b, c, d)
ans = []
%w[add sub mul div].repeated_permutation(3).map do |x, y, z|
shuf -e 筑波 大学 核 実験|sed 1i$'#\n'2aは$'\n'4aをやめろ|tr -d \\n;echo
shuf -ern4 筑波 大学 核 実験|sed 1i$'#\n'2aは$'\n'4aをやめろ|tr -d \\n;echo
shuf -en4 筑波 大学 核 実験|xargs|sed 's/^/#/;s/ //;s/ /は/;s/ //'
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
(function () {
var timer = 100;
document
.querySelectorAll("div > input[type='checkbox']:checked")
.forEach((interest) => {
setTimeout(function () {
interest.click();
}, timer);
timer += 2000;
});