Skip to content

Instantly share code, notes, and snippets.

@uniacid
uniacid / python27_on_debian.sh
Created December 2, 2015 16:32 — forked from lukaslundgren/python27_on_debian.sh
How to install python 2.7 on debian
sudo apt-get install build-essential libsqlite3-dev zlib1g-dev libncurses5-dev libgdbm-dev libbz2-dev libreadline5-dev libssl-dev libdb-dev
wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz
tar -xzf Python-2.7.3.tgz
cd Python-2.7.3
./configure --prefix=/usr --enable-shared
make
sudo make install
cd ..
<?php
namespace JukeboxApi;
use GuzzleHttp\Psr7\Request;
use GuzzleHttp\Client as HttpClient;
const TEMPLATE_REGEXP = '/\{([^\{\}]+)\}/';
/**
@uniacid
uniacid / offer.js
Created July 5, 2016 18:03
offer js
class UpdateOfferByMetal {
constructor(offerUpdateMethod, actualValue, event) {
if (!offerEditingCellInstance) {
offerEditingCellInstance = this;
}
this.offerUpdateMethod = offerUpdateMethod;
this.actualValue = actualValue;
this.obj = event;
this.offerEditingCell = false;
this.editStatus = $(this.obj).parent().data('edit-status');
@uniacid
uniacid / beefprime.php
Created July 6, 2016 20:26
Find the 444th Prime number converted to hexadecimal which contains the word "beef"
<?php
set_time_limit(0);
function isPrime($number) {
$sqrt = ceil(sqrt($number));
if ($number <= 1) {
return FALSE;
} else if ($number <= 3) {
return TRUE;
} else if ( !($number % 2) || !($number % 3) ) {
return FALSE;
#!/usr/bin/perl
#
# tracker_modify.pl 0.01
# Add/delete trackers recursively from all torrents.
# Free to copy and mutilate any way you like :)
#
# Originally from http://publicbt.com/tracker_modify.pl
sub usage {
print <<EOF
@uniacid
uniacid / autodl-irssi
Created January 13, 2017 18:48 — forked from phracker/autodl-irssi
A system init script for autodl-irssi
#!/bin/sh
# https://github.com/phracker
#
# AutoDL-Irssi Init Script
# Tested on Debian 7 (Wheezy)
# Instructions:
# - Install / configure irssi + autodl-irssi (duh)
# - Save this script as /etc/init.d/autodl-irssi
# - `chmod +x /etc/init.d/autodl-irssi`
# - `insserv autodl-irssi`
@uniacid
uniacid / Vagrantfile
Created March 3, 2017 20:19
Vagrant configuration file with OS detection - on windows we mount shared folders without NFS - on all other OS we use NFS for speeding up the project inside the virtual machine
# -*- mode: ruby -*-
# vi: set ft=ruby :
module OS
def OS.windows?
(/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil
end
def OS.mac?
(/darwin/ =~ RUBY_PLATFORM) != nil
@uniacid
uniacid / pd2.lua
Created April 8, 2017 21:47
pd2s
chance = 70.71
bethigh = true
basebet = 0.00000022
firstlossbet = 0.00000222
secondlossbet = 0.00002222
thirdlossbet = 0.00022222
nextbet = basebet
counter=0
betcount=0
@uniacid
uniacid / fizzbuzz.php
Created November 18, 2017 06:57
Fizz Buzz
<?php
function fizzbizz()
{
for ($i = 0; $i <= 100; $i++) {
if ( ($i % 3 == 0) && ($i % 5 == 0) ) {
echo "FizzBuzz\r\n";
} elseif ($i % 3 == 0) {
echo "Fizz\r\n";
} elseif ($i % 5 == 0) {
echo "Buzz\r\n";
DROP TEMPORARY TABLE IF EXISTS MRReport;
# Create temp table
CREATE TEMPORARY TABLE MRReport
# Insert Initial Data
SELECT
# MRR Year
`mntMRR`.MrrYear,
# MRR Month
`mntMRR`.MrrMonth,
# MRR Total