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
#!/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
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
<?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
# 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
#!/bin/sh | |
# | |
if [ -n "$1" ]; | |
then | |
git clone git://github.com/zendframework/ZendSkeletonApplication.git --recursive $1 | |
else | |
echo "no project given" |
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
#!/bin/bash | |
# Lithifyme script. | |
# Creates a new project based on lithium. | |
# @Author David Duggins [[email protected]] | |
# Released under the GPLv3 | |
if [ ! -d "$1" ]; then | |
git clone git://github.com/UnionOfRAD/framework.git $1 | |
echo "initializing submodules" | |
cd $1 |
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
! /bin/bash | |
SLEEP_TIME=5 # Default time between checks. | |
SAFE_PERCENT=30 # Still safe at this level. | |
DANGER_PERCENT=15 # Warn when battery at this level. | |
CRITICAL_PERCENT=5 # Hibernate when battery at this level. | |
NAGBAR_PID=0 | |
export DISPLAY=:0.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
#!/usr/bin/ruby | |
require 'open-uri' | |
require 'json' | |
url = 'http://hipsterjesus.com/api?paras=1' | |
buffer = open(url, "UserAgent" => "Ruby-Wget").read | |
# convert JSON data into a hash |
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/python | |
import sys, getopt | |
def main(argv): | |
server = '' | |
path = '' | |
try: | |
opts, args = getopt.getopt(argv, "hs:p:", ["server=", "path="] ) |