Skip to content

Instantly share code, notes, and snippets.

View rymcol's full-sized avatar

Ryan Collins rymcol

View GitHub Profile
@rymcol
rymcol / UIColorFromHex.swift
Last active April 15, 2016 22:56
UIColor Extension to Initialize from HEX Color Values
//
// UIColor Extension.swift
// Uses Swift 2.0
//
// Created by Ryan Collins on 9/22/15.
//
//
import Foundation
import UIKit
@rymcol
rymcol / perfect-handler-boilerplate.swift
Created April 25, 2016 19:27
Generic boilerplate code for new Perfect handlers
import PerfectLib
//public method that is being called by the server framework to initialise your module.
public func PerfectServerModuleInit() {
 
    // Install the built-in routing handler.
    // Using this system is optional and you could install your own system if desired.
    Routing.Handler.registerGlobally()
 
    // Create Routes
    Routing.Routes["GET", ["/", "index.html"] ] = { (_:WebResponse) in return IndexHandler() }
@rymcol
rymcol / bulk_cpanel_whm_password_resets.py
Created May 20, 2016 22:37
Bulk Password Reset for WHM/cPanel in Python
#!/usr/bin/env python
from urllib import urlencode
import httplib2, base64, json
filewithdomains = '/path/to/domains.txt'
resellerlogin = 'root'
resellerpass = 'password'
whmip = '123.456.789.000'
import urllib2 as ur
import re
f = ur.urlopen(u'http://website.com/SiteMap.xml')
res = f.readlines()
for d in res:
data = re.findall('<loc>(http:\/\/.+)<\/loc>',d)
for i in data:
print i
@rymcol
rymcol / cPanel Account Creator
Last active May 20, 2016 22:41
Creates cPanel Accounts from a txt file list of domains
#!/usr/bin/env python
from urllib import urlencode
import httplib2, base64, json
filewithdomains = '/path/to/domains.txt'
resellerlogin = 'root'
resellerpass = 'password'
whmip = '123.456.789.000'
~/Library/Containers/com.apple.iWork.Pages/Data/Library/Application Support/User Templates
#element li {
border: 1px solid #000;
display: -moz-inline-stack;
display: inline-block;
vertical-align: top;
zoom: 1;
*display: inline;
_height: 250px;
}
@rymcol
rymcol / rebuild.fish
Created August 17, 2016 17:36
Fish Function (alias) for Rebuilding Swift Projects
function rebuild
swift build --clean; and swift build
end
@rymcol
rymcol / cleanbuild.fish
Created August 17, 2016 17:37
Fish Function (alias) for Rebuilding Swift Projects Including Fresh Dependency Pulls
function cleanbuild
swift build --clean=dist; and swift build
end

Keybase proof

I hereby claim:

  • I am rymcol on github.
  • I am collins (https://keybase.io/collins) on keybase.
  • I have a public key whose fingerprint is 2745 210F 8BCA 3234 8ABB C852 1107 08F9 8B65 5205

To claim this, I am signing this object: