Skip to content

Instantly share code, notes, and snippets.

View lancepioch's full-sized avatar
💨
Swishing in some good code

Lance Pioch lancepioch

💨
Swishing in some good code
View GitHub Profile
#!/bin/bash
php_ini=/path/of/php.ini
__module="$2"
[[ ! -f $php_ini ]] && { echo "Error: Can not found $php_ini" >&2;
echo "Please define php.ini path in $php_ini";
exit 1; }
@lancepioch
lancepioch / algorithms.md
Last active November 3, 2016 07:22
Computer Science Algorithms Everyone Should Know
@lancepioch
lancepioch / micromanage.py
Created September 2, 2014 14:06
Micromanage Python Script - http://pastebin.com/J86M3vYb
#!/usr/bin/env python2
from PIL import Image
from PIL.ImageStat import Stat
from time import sleep
from Xlib import X
from Xlib.display import Display
from Xlib.ext.xtest import fake_input
from Xlib.X import ZPixmap
@lancepioch
lancepioch / resize.cmd
Created September 16, 2014 21:52
ffmpeg command to resize all pictures in a directory to 2048x2048 or less
for /f "delims=|" %f in ('dir /b .') do ffmpeg -i "%f" -vf "scale='if(gt(iw, ih),2048,-1)':'if(gt(ih, iw),2048,-1)'" "%f.jpg"
@lancepioch
lancepioch / pinger.py
Last active August 29, 2015 14:13
[Python 3] Pinger is a tiny window that tells you your current average ping
import re, subprocess, tkinter, threading
fontsize = 20
timeregex = r'(?<=time=)\d+(?=ms )' # regex to retrieve the # ms
website = 'google.com' # url to ping
pinglimit = 10 # number of pings to average
pinginterval = 500 # ms delay between pings
pings = [] # array to hold pings
def avg(l):
<?php
$teamspeakServer = TeamSpeak3::factory(config('services.teamspeak.connect'));
$teamspeakServer->selfUpdate(['client_nickname' => '~Display~']);
$channels = $teamspeakServer->channelList();
$clients = $teamspeakServer->clientList();
foreach ($clients as $client) {
if ($client['client_database_id'] == '298336') {
foreach ($channels as $channel) {
@lancepioch
lancepioch / audiocables.au3
Created August 12, 2015 01:39
Automatic Setup for Virtual Audio Cables
$vac = "C:\Program Files\Virtual Audio Cable\audiorepeater.exe";
$ar = "Audio Repeater";
$ss = "SelectString";
Run($vac);
WinWait($ar);
ControlCommand($ar, "", 1001, $ss, "Microphone");
ControlCommand($ar, "", 1002, $ss, "Line 2");
ControlClick($ar, "", 1000, "left", 1);
<?php
namespace Hardwire\Console\Commands;
use Illuminate\Console\Command;
use TeamSpeak3;
class CopyChannelsCommand extends Command
{
<?php
class UserTableSeeder extends Seeder {
public function run()
{
$now = Carbon::now('utc')->toDateTimeString();
DB::table('steams')->delete();
DB::table('users')->delete();
@lancepioch
lancepioch / keybase.md
Created November 2, 2015 05:48
keybase.md

Keybase proof

I hereby claim:

  • I am lancepioch on github.
  • I am lancepioch (https://keybase.io/lancepioch) on keybase.
  • I have a public key whose fingerprint is 3135 D654 9ED7 CD19 34D6 DDBA 9984 1E48 D068 6B03

To claim this, I am signing this object: