Skip to content

Instantly share code, notes, and snippets.

View PHLAK's full-sized avatar
Coffee... always coffee...

Chris Kankiewicz PHLAK

Coffee... always coffee...
View GitHub Profile
@PHLAK
PHLAK / TabLi.html
Created June 16, 2009 21:15
Simple AJAX serverd tabs with caching
<h1>My Account</h1>
<div id="account-tabs" class="clearfix">
<ul>
<li id="account-dashboard" class="tabli"><a href="/account/dashboard">Account Dashboard</a></li>
<li id="order-history" class="tabli"><a href="/account/order-history">Order History</a></li>
<li id="address-book" class="tabli"><a href="/account/address-book">Address Book</a></li>
</ul>
</div>
@PHLAK
PHLAK / autoexec.cfg
Last active July 5, 2022 17:01
L4D2 autoexe.cfg
// ---------------------------------------------------------------------------------------------- //
// -----| NETCODE OPTIMIZATIONS |---------------------------------------------------------------- //
// ---------------------------------------------------------------------------------------------- //
cl_cmdrate "30" // Command packets sent to server per second (Default 30)
cl_updaterate "30" // Packets per second you request from the server (Default 20)
cl_interp "0.067" // Interpolation value to match updaterate 30 (Default 0.1)
rate "30000"; // Max bytes/sec the host can receive data (Default 10000)
@PHLAK
PHLAK / ip-uploader.sh
Created February 14, 2011 16:21
Simple script for getting your external IP and uploading it to a server via SCP.
#!/bin/bash
# Define your server information here
SERVER="<hostname_or_ip>"
PORT="22"
USER="<user_name>"
FILEPATH="<file_path>"
# Get IP from whatismyip.com and store it in a file
wget http://www.whatismyip.com/automation/n09230945.asp -O ip.txt
@PHLAK
PHLAK / ip-uploader.py
Created February 14, 2011 16:32
Connects to whatismyip.com, obtains your external IP address and uploads a text file containg the IP to a chosen FTP server. Requires Python to run.
#! /usr/bin/env python
import httplib
import sys
import os
import ftplib
# File IP will be output to
file="ip.txt"
# Replace server, user, and password with your login information
@PHLAK
PHLAK / workspace-fsck.sh
Last active March 19, 2020 17:52
Performs fsck and gc on all Git repositories in a given directory.
#!/usr/bin/env bash
set -o errexit pipefail
WORKSPACE=${HOME}/workspace # Path to your workspace
find ${WORKSPACE} -name '.git' -type d | while read LINE; do
pushd "${LINE}/../"
git fsck && git gc
popd
done
@PHLAK
PHLAK / colorful-characters.php
Created July 6, 2011 16:26
Generates random characters with random background and foreground colors.
<?php
function randColor() {
$randDec = rand(0, 16777215);
$randHex = dechex($randDec);
$color = '#' . $randHex;
return $color;
}
<?php
for ($x = 1; $x <= 100; $x++) {
if ($x % 3 === 0 && $x % 5 === 0) {
echo 'FizzBuzz';
} elseif ($x % 3 === 0) {
echo 'Fizz';
} elseif ($x % 5 === 0) {
echo 'Buzz';
@PHLAK
PHLAK / dlCleanup.py
Created March 24, 2012 21:40
Deletes files older than 14 days from a given folder.
import os
import time
path = "E:\\Downloads"
now = int(time.time())
dirList = os.listdir(path)
for fileName in dirList:
filePath = path + "\\" + fileName
@PHLAK
PHLAK / BttF.php
Created March 27, 2012 19:25
Back to the Future as code.
<?php
$date = date('M d, Y - h:i A', 499155600); // Oct 26, 1985 - 01:20 AM
$libyans = false;
$speed = 0;
$watts = 1210000000;
while ($libyans == true) {
if ($speed >= 88 && $watts == 1210000000 ) {
@PHLAK
PHLAK / autoexec.cfg
Last active August 25, 2019 20:25
Custom Dota 2 autoexec.cfg
// -------------------------------------------------------------------------- //
// -----| PERFORMANCE |------------------------------------------------------ //
// -------------------------------------------------------------------------- //
fps_max 200
@panorama_max_fps 200
@panorama_vsync 0
echo "/* ---------------------------------------------------- */"