Skip to content

Instantly share code, notes, and snippets.

@dkrusky
dkrusky / HMAC.swift
Created November 26, 2018 00:36 — forked from MihaelIsaev/HMAC.swift
Easy to use Swift implementation of CommonCrypto HMAC. You can easily hash your String to: md5, sha1, sha224, sha256, sha384, sha512 with pure Swift.
//
// HMAC.swift
//
// Created by Mihael Isaev on 21.04.15.
// Copyright (c) 2014 Mihael Isaev inc. All rights reserved.
//
// ***********************************************************
//
// How to import CommonCrypto in Swift project without Obj-c briging header
//
@dkrusky
dkrusky / curl.inc.php
Created October 31, 2018 09:09
Ultimate curl wrapper
<?php
//abstract class curl {
class curl {
private $error_codes;
private $_headers;
private $_options;
public $headers;
@dkrusky
dkrusky / Program.cs
Created July 30, 2018 16:04
ZygorGuides Fixer (Console C#) - Removes references to files and guides that dont exist as well as Trial references, and removes languages that aren't in your current Locale.
using Microsoft.Win32;
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
namespace ZygorFixer {
class Program {
// property to store world of warcraft install path
public static string InstallPath { get; private set; }
@dkrusky
dkrusky / TitanClock.lua
Created July 20, 2018 19:07
Titan Panel patch to work with World of Warcraft BFA pre-patch 8.0.1
-- **************************************************************************
-- * TitanClock.lua
-- *
-- * By: TitanMod, Dark Imakuni, Adsertor and the Titan Development Team
-- **************************************************************************
-- ******************************** Constants *******************************
TITAN_CLOCK_ID = "Clock";
local TITAN_CLOCK_FORMAT_12H = "12H";
local TITAN_CLOCK_FORMAT_24H = "24H";
@dkrusky
dkrusky / mysqli2mysqli.php
Created April 18, 2018 09:05
Wrapper to convert a php site mysql_ procedural to mysqli_ without having to change any code where mysql_ procedural commands are no longer available. (migrating from php 5 to php 7)
<?php
// include this file somewhere that the entire project will have access to it, and disable the old mysql extension.
if(!function_exists('mysql_connect')) {
function mysql_connect($server, $username, $password, $new_link=false) {
return mysqli_connect($server, $username, $password );
}
function mysql_query( $query, $link_identifier ) {
return mysqli_query($link_identifier, $query);
@dkrusky
dkrusky / grant-root-remote-with-grant.sql
Created April 3, 2018 10:30
Grant root full remote access to mysql database with grant abilities
grant all privileges on *.* to 'root'@'%' with grant option;
flush privileges;
@dkrusky
dkrusky / install-mysql-apt-debian-9.sh
Created February 26, 2018 05:56 — forked from anonymous/install-mysql-apt-debian-9.sh
Install MySQL APT for Debian 9
#!/bin/bash
apt install dirmngr
apt-key adv --keyserver pgp.mit.edu --recv-keys 5072E1F5
echo 'deb http://repo.mysql.com/apt/debian/ stretch mysql-5.7' > /etc/apt/sources.list.d/mysql.list
apt update
apt upgrade
apt install mysql-community-server
@dkrusky
dkrusky / install-python
Created April 11, 2017 18:57
Install specified version of Python from source on Debian 8
#!/bin/bash
if [ -z "$1" ]
then
echo "Syntax: install-python <version>"
echo "Example: install-python 3.6.1"
exit;
fi
apt-get install packaging-dev debian-keyring devscripts equivs python python-dev python3 python3-dev python3-pip libxml2-dev libacl1-dev direnv
wget https://www.python.org/ftp/python/$1/Python-$1.tgz
tar xvf Python-$1.tgz
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using System.Collections.Specialized;
class DataService {
public NameValueCollection Query { get; set; }
public string Endpoint { get; set; }
public FormUrlEncodedContent QueryEncoded {
@dkrusky
dkrusky / adblockextras.txt
Last active January 21, 2017 20:31
Additional blocks for AdBlock that subscriptions still allowed through. Blocks nasty stuff like "... call this 800 number" type messages.
[Adblock Plus 2.0]
! Version: 201701212030
! Title: NastyDropper
! NastyDropper subscription
! Last modified: 21 Jan 2017 20:30 UTC
! Homepage: https://gist.github.com/microvb
js.shoppingthankyoupages.com
||st.chatango.com/h5/gz/r0529151223/id.html
||asdl.us/wp-content/themes/Tuan123456/images/no-thumbnail.png
*.exoclick.com/*