Skip to content

Instantly share code, notes, and snippets.

View tbreuss's full-sized avatar
🚴‍♂️
Biking

tebe tbreuss

🚴‍♂️
Biking
View GitHub Profile
@brianclements
brianclements / Commit Formatting.md
Last active May 31, 2024 06:57
Angular Commit Format Reference Sheet

Commit Message Format

This specification is inspired by and supersedes the [AngularJS commit message format][commit-message-format].

We have very precise rules over how our Git commit messages must be formatted. This format leads to easier to read commit history.

Each commit message consists of a header, a body, and a footer.

@gknapp
gknapp / wsse.php
Last active March 12, 2022 19:17
Add WSSE support to PHP's soapclient
<?php
class WsseHeader
{
const NS_WSSE = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd';
const NS_WSSEPSWD = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText';
public function build($username, $password)
{
$header = sprintf(
@kharysharpe
kharysharpe / copydb.php
Last active March 20, 2023 08:48
Copy a table from one MYSQL database server to another database another
<?php
/**
*
* Code was adapted from SitePoint
* http://www.sitepoint.com/forums/showthread.php?697857-Copy-mysql-table-from-one-server-to-another-through-php&s=b5b25e09ff44749d2e49e0d7c1640fd8&p=4680578&viewfull=1#post4680578
*
*/
// Prevent script from timing out
set_time_limit(0);
@natelandau
natelandau / .bash_profile
Last active May 20, 2024 08:41
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@magnetikonline
magnetikonline / example.php
Last active February 10, 2021 21:01
PHP reading of sub directories for files using recursion and generators.
<?php
// using generators (yield) to recursively read files from a source path
// more: http://www.php.net/manual/en/language.generators.php
foreach (readFileSubDir('~/testdir') as $fileItem) {
echo($fileItem . "\n");
}
function readFileSubDir($scanDir) {
@ryansechrest
ryansechrest / php-style-guide.md
Last active May 5, 2024 18:00
PHP style guide with coding standards and best practices.

PHP Style Guide

All rules and guidelines in this document apply to PHP files unless otherwise noted. References to PHP/HTML files can be interpreted as files that primarily contain HTML, but use PHP for templating purposes.

The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

Most sections are broken up into two parts:

  1. Overview of all rules with a quick example
  2. Each rule called out with examples of do's and don'ts
@joakimbeng
joakimbeng / router.html
Last active March 15, 2024 06:18
A really simple Javascript router
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Building a router</title>
<script>
// Put John's template engine code here...
(function () {
// A hash to store our routes:
@cpliakas
cpliakas / ant-composer.xml
Created November 26, 2013 01:20
Apache Ant tagets for Composer commands.
<?xml version="1.0" encoding="UTF-8"?>
<project name="Composer Targets" default="build">
<property name="builddir" value="${basedir}/build"/>
<property name="composer" value="${builddir}/composer.phar"/>
<target name="php-check">
<condition property="php" value="php">
<not>
<isset property="${php}"/>
@fedeghe
fedeghe / replaceall.js
Last active January 31, 2023 08:04
A useful function to give values to a template full of placeholders
/**
* [ description]
* @param {string} tpl the template
* @param {literal|function} obj a literal for substitution or a function that will
* return the substitution given as parameter a string
* @param {string} start optional- the opening placeholder delimitator (%)
* @param {string} end optional- the closing placeholder delimitator (%)
* @param {string} fb optional- a fallback value in case an element is not found
* @return {string} the resulting string with replaced values
*/
@kristopherjohnson
kristopherjohnson / Makefile
Last active March 14, 2024 20:42
Makefile that uses Pandoc to generate HTML, PDF, DOCX, etc. from Markdown source files
# Makefile
#
# Converts Markdown to other formats (HTML, PDF, DOCX, RTF, ODT, EPUB) using Pandoc
# <http://johnmacfarlane.net/pandoc/>
#
# Run "make" (or "make all") to convert to all other formats
#
# Run "make clean" to delete converted files
# Convert all files in this directory that have a .md suffix