Skip to content

Instantly share code, notes, and snippets.

@mushketer888
mushketer888 / blockdelfi.js
Last active October 26, 2022 07:12
TamperMonkey Block delfi.lv/* AD popup
// ==UserScript==
// @name Block Delfi.LV ads
// @namespace http://tampermonkey.net/
// @version 0.2
// @description try to take over the world!
// @author You
// @match https://www.tampermonkey.net/index.php?version=4.18.0&ext=dhdg&updated=true
// @icon https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net
// @match https://rus.delfi.lv/*
// @match https://www.delfi.lv/*
@mushketer888
mushketer888 / fix.txt
Created October 8, 2020 15:31
Dell G3 3500 Ubuntu 18.04 Periodically disconnects WiFi fix
sudo modprobe -r iwldvm iwlwifi
sudo modprobe iwlwifi 11n_disable=1 bt_coex_active=0 power_save=0 auto_agg=0 swcrypto=1
Add line to /etc/modprobe.d/iwlwifi.conf
options iwlwifi 11n_disable=1 bt_coex_active=0 power_save=0 auto_agg=0 swcrypto=1
And restart
@mushketer888
mushketer888 / serve.php
Created August 5, 2017 10:54
Laravel 5 artisan serve custom public path
If you have public in ../ and laravel in directory (good for shared hosting)
/app/Console/Commands/Serve.php
<?php
namespace App\Console\Commands;
use Exception;
use Illuminate\Console\Command;
@mushketer888
mushketer888 / gist:e0483f91d7f1e3848f543a542a7693ff
Created June 3, 2017 18:56
PHP email tracker. when email is opened get date,ip etc and save (append) to file
<?php
header("Content-Type: image/jpeg"); // it will return image
echo hex2bin('89504e470d0a1a0a0000000d494844520000000100000001010300000025db56ca00000003504c5445000000a77a3dda0000000174524e530040e6d8660000000a4944415408d76360000000020001e221bc330000000049454e44ae426082');
$id=$_GET['id'];
function get_client_ip() {
$ipaddress = '';
if (isset($_SERVER['HTTP_CLIENT_IP']))
$ipaddress = $_SERVER['HTTP_CLIENT_IP'];
else if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))
$ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];
drawOHLC<-function(x,O,H,L,C){
#print(paste(x,O,H,L,C))
rect(x-0.8,O,x-0.2,C,col=ifelse(O>=C,"blue","red"),border="black")
lines(
c(x-0.5,x-0.5),
c(max(O,C),
max(O,H,L,C)),
col="black")
lines(
@mushketer888
mushketer888 / TestNeuro.java
Created March 3, 2017 15:25
Neuroph Neural Network with Jenetics Genetic Alghorithm
import java.time.Clock;
import java.time.Duration;
import java.util.Arrays;
import org.jenetics.*;
import org.jenetics.engine.Engine;
import org.jenetics.engine.EvolutionStatistics;
import org.jenetics.util.Factory;
import org.neuroph.core.NeuralNetwork;
@mushketer888
mushketer888 / gist:5b10f14848f4b6271adb983dd0db1727
Last active August 7, 2016 16:10
Fann2MQL save/open file patch!
For mt4 build 600+
Must convert path to unicode char!
string path=.....
//save
uchar p[];
StringToCharArray(path,p,0,-1,CP_ACP);
ret=f2M_save(ann,p);