This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Lets tell Puppet the order of our stages | |
stage { | |
'users': before => Stage['repos']; | |
'repos': before => Stage['packages']; | |
'packages': before => Stage['configure']; | |
'configure': before => Stage['services']; | |
'services': before => Stage['main']; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
class Blog extends CI_Controller { | |
function __construct() | |
{ | |
parent::__construct(); | |
} | |
function index() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isTable($string) { | |
if (preg_match("/^cms_/i", $string)) { //this is where you place the regex that you want to test | |
return TRUE; | |
} else { | |
return FALSE; | |
} | |
} | |
$string= ["cms_phone_apps", "cms_phone", "cms phone", "phone_cms"]; //using php 5.4's new array syntax rocks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# file: rip_site.py | |
import sys | |
import os | |
domain = sys.argv[1] | |
path = sys.argv[2] | |
os.system ('wget --recursive --no-clobber -- page-requisites --html-extension --convert-links --restrict-file-names=windows --domains ' + domain + ' --no-parent ' + path) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
using namespace std; | |
struct person_t { | |
string name; | |
int age; | |
} mine, yours; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function bcrypt($password, $salt) | |
{ | |
//Checks to see if blowfish is installed on the server | |
CRYPT_BLOWFISH or die ('No Blowfish found.'); | |
$password = $password; | |
$salt = $salt; | |
//This sets up the Blowfish prefix and end | |
$Blowfish_Pre = '$2a$05$'; //this instructs blowfish to encrypt 5 passes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'nokogiri' | |
puts 'parsing xml file' | |
parsed = Nokogiri::XML(open("./wordpress.2010-10-06.xml")) | |
puts 'pulling titles' | |
i = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once('includes/db.inc.php'); | |
$results = mysql_query('SELECT ID, Alere_PID FROM qcl.alere'); | |
while($row = mysql_fetch_assoc($results)){ | |
$current_pid = $row['Alere_PID']; | |
$pid_results = mysql_query("SELECT Question, Answer FROM qcl.alere_results WHERE PID = '$current_pid'"); | |
while($pid_row = mysql_fetch_row($pid_results)){ | |
$question = $pid_row[0]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Pizza | |
def initialize(&factory) | |
@factory = factory | |
end | |
def bake | |
@factory.call | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GetLastFmFeed | |
def self.displayFeed | |
require 'rss' | |
require 'open-uri' | |
@lastfmArray = [] | |
rss = RSS::Parser.parse open('http://ws.audioscrobbler.com/1.0/user/minasmir/recenttracks.rss').read, false | |
puts rss.channel.title |