Skip to content

Instantly share code, notes, and snippets.

View 1d10t's full-sized avatar
❄️
winter in russian midland is longer than 1/2 of year

Serg 1d10t

❄️
winter in russian midland is longer than 1/2 of year
View GitHub Profile
@1d10t
1d10t / contacts2.db-to-vcf.php
Created May 27, 2017 00:53
android contacts2.db to vcard file (vcf) converter
<?php
ini_set('mbstring.language', 'Russian');
function db(){
static $db = null;
if(!$db){
$db = new SQLite3(__DIR__.'/contacts2.db');
$db->busyTimeout(60*60*1000);
@1d10t
1d10t / list_cadastre_ids.js
Last active April 8, 2017 09:33
list cadastre ids in region
function getXmlHttp(){
var xmlhttp;
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
// url deobfuscation function '129' from audioplayer.js
(function(t, i) {
"use strict";
function e(t) {
if (~t.indexOf("audio_api_unavailable")) {
var i = t.split("?extra=")[1].split("#"),
e = o(i[1]);
if (i = o(i[0]), !e || !i) return t;
e = e.split(String.fromCharCode(9));
@1d10t
1d10t / m3u8-downloader.ahk
Last active March 21, 2017 03:18
This script downloading remote MP3 files from M3U playlist and saving it with cute file names
fileext_from_url(url, default_ext = "mp3")
{
url_wo_query := RegExReplace(url, "(\?.*)?(#.*)?$", "")
SplitPath, url_wo_query, , , , fn
return, % fn "." ext_from_url(url, default_ext)
}
ext_from_url(url, default = "mp3")
{
@1d10t
1d10t / vk_m3u.js
Last active March 23, 2018 11:17
vkontakte music m3u generating content script
/*
run in console at https://vk.com/audio
to download from wall, go to https://vk.com/wall[ID]?own=1&offset=[OFFSET]
wait for m3u file
use this autohotkey script https://gist.github.com/1d10t/6f8b151e50905449c63abc851dceb167
to download mp3 files
*/
(function(){
@1d10t
1d10t / html_audio_balance_stereo.js
Created March 9, 2017 02:57
htmlaudioelement (audio) random stereo balance example
HTMLAudioElement.prototype.balance = function(leftValue, rightValue){
if(!this.leftGain || !this.rightGain){
var audioCtx = new AudioContext();
if(audioCtx.destination.channelCount != 2){
console.log('Destination channel count is not two:', audioCtx.destination.channelCount);
return;
}
var audioSrc = audioCtx.createMediaElementSource(this);
<?php
class slowAES_aes
{
static $keySize = array(
'SIZE_128' => 16,
'SIZE_192' => 24,
'SIZE_256' => 32
);
@1d10t
1d10t / scr
Created December 19, 2016 16:02
screen tool: list, attach, reattach
#!/usr/bin/php
<?php
error_reporting(E_ALL);
function scr_ls(){
ob_start();
passthru('screen -ls');
$ss = explode("\n", ob_get_clean());
$scrs = array();
@1d10t
1d10t / ade1i52, adg0i56(?), adg0i57. e0-e3 immo on-off
Last active November 23, 2016 22:16
hyundai accent tagaz stock/commercial firmware changes block list
0)
offset: 65545 0x10009
end: 65546 0x1000a
size: 2
1)
offset: 65549 0x1000d
end: 65549 0x1000d
size: 1
2)
offset: 65552 0x10010
@1d10t
1d10t / cscart_cron.php
Last active November 30, 2016 16:44
cs-cart cron wrapper
#!/usr/bin/php
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
ini_set('memory_limit','1G');
set_time_limit(0);
$opt = getopt('', array(
'host:',
'dir:',