Skip to content

Instantly share code, notes, and snippets.

@kourindouhime
kourindouhime / yota2020.rb
Created January 9, 2020 11:05
Free yota 2020
require 'open-uri'
begin
req = open("http://ya.ru")
if req.base_uri.to_s.include? "yota"
puts "Enabling freebies"
#req2 = open("http://hello.yota.ru/wa/v1/service/temp/sa")
`curl 'http://hello.yota.ru/wa/v1/service/temp/sa' -H 'Accept: application/json, text/plain, */*' -H 'Referer: http://hello.yota.ru/sa/?redirurl=http:%2F%2Fya.ru%2F' -H 'Origin: http://hello.yota.ru' -H 'X-Requested-With: XMLHttpRequest' -H 'User-Agent: Mozilla/5.0 (X11; Linux armv7l) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.89 Safari/537.36' -H 'Content-Type: application/json;charset=UTF-8' --data-binary '{}' --compressed`
#puts req2.read
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
var items = document.getElementsByTagName("*");
var ebashilovo = false;
setInterval(function() {
if (ebashilovo == true) {
for (i of items) {
it = []; $(".featured-list-item").each(function() { it.push([$(this).find("h2").find("a").html(), parseFloat($(this).find("p").find("strong").html().replace("as low as $", ""))]); }); it = it.sort(function(a, b){ var x=a[1]; var y=b[1]; return y-x; }); $.each(it, function() { console.log(this); })
@kourindouhime
kourindouhime / gist:a3e2f6d69f538b8e8dcb
Last active August 29, 2015 14:23
Instagram scroll pictures by pressing down key
$(document).keydown(function(e) { if(e.which == 40) { $("article").each(function() { if ($(this).offset().top > $(document).scrollTop()) { $(document).scrollTop($(this).offset().top+5); return false; } }); } e.preventDefault(); });
@kourindouhime
kourindouhime / gist:b9d419c776892c0325e8
Created December 25, 2014 23:17
pg_dump databases in list
while read line; do sudo -u postgres /usr/bin/pg_dump $line > /media/storage00/pgdump/$line-$(date +%d-%m-%Y).sql; done < /var/lib/postgresql/backup-list.txt
// tanuki 2019
havka = [];
s = __NEXT_DATA__.props.initialState.products.data
for (key of Object.keys(s)) {
p = s[key];
havka.push([p.title, p.weight/p.price, p.price, p.weight, p.calories])
}
havka = havka.sort(function(a, b){ var x=a[1]; var y=b[1]; return y-x; });
eblo = "";