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 / jquery-cdn-test.sh
Created January 31, 2014 17:25
Test average response times for jQuery from Google and jQuery CDNs
#!/bin/bash
## Set the url
if [[ "$1" == "google" ]]; then
URL="ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"
elif [[ "$1" == "jquery" ]]; then
URL="code.jquery.com/jquery-2.0.3.min.js"
@PHLAK
PHLAK / keybase.md
Created March 25, 2014 16:50
keybase.md

Keybase proof

I hereby claim:

  • I am PHLAK on github.
  • I am ChrisKankiewicz (https://keybase.io/ChrisKankiewicz) on keybase.
  • I have a public key whose fingerprint is 7C25 1D83 939B 1898 6DD6 7F0A E008 E594 373D 7E9D

To claim this, I am signing this object:

import os
import time
path = "U:\\Downloads"
now = int(time.time())
dirList = os.listdir(path)
for fileName in dirList:
filePath = path + "\\" + fileName
@PHLAK
PHLAK / openstack-tools-installer.sh
Last active August 29, 2015 14:05
Quick script for installing OpenStack python clients.
#!/usr/bin/env bash
## Require root privileges
if [[ "$(whoami)" != "root" ]]; then
echo "ERROR: You must be root to run this script"
exit 1
fi
## Install python-pip if missing
if [[ ! $(dpkg -l python-pip) ]]; then
@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 / 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 / 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 / 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