Skip to content

Instantly share code, notes, and snippets.

View jesgs's full-sized avatar
🍜
Ramen connoisseur

Jess Green jesgs

🍜
Ramen connoisseur
View GitHub Profile
@BrendonVanHeyzen
BrendonVanHeyzen / gist:1004998
Created June 2, 2011 18:42
Zend_Acl Bootstrap
<?php
/**
* Our bootstrap
*/
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
/**
* Will init our acl
*
* @return void
@kaiohken1982
kaiohken1982 / Multicheckboxes.php
Created December 22, 2011 14:36
Zend Form Element Multicheckboxes unordered list tag ul
<?php
class My_Form_Template extends My_Form
{
public function init()
{
parent::init();
$this->addElements(array(
$this->createElement(self::TYPE_MULTICHECKBOX, 'checks', array(
@styledev
styledev / acf.php
Created August 29, 2012 21:50
This code will upgrade ACF to allow for multi-item reverse loopkup by giving each relationship connection a 'rel_$post_type' meta_key with a serialized array of posts containing the post_ids of the originating post.
// Added "before_delete_post" action to trigger rel_cleanup (cleans up all associated posts with rel_ meta_keys when a post is deleted)
function Acf()
{
// vars
$this->path = plugin_dir_path(__FILE__);
$this->dir = plugins_url('',__FILE__);
$this->version = '3.3.9';
$this->upgrade_version = '3.3.3'; // this is the latest version which requires an upgrade
$this->cache = array(); // basic array cache to hold data throughout the page load
@Gisleburt
Gisleburt / AbstractBehatContex.php
Created October 17, 2014 14:19
Use Laravel's Artisan to set the fixtures for your tests
class AbstractBehatContext extends MinkContext {
/**
* Slight hack to put beforeSuite code into beforeScenario
* @var bool
*/
protected static $databaseReady = false;
/**
* @BeforeScenario
@mombrea
mombrea / Twitter URL Parsers
Created September 17, 2013 18:08
JavaScript prototype functions to parse out twitter action items into HTML
//Twitter Parsers
String.prototype.parseURL = function() {
return this.replace(/[A-Za-z]+://[A-Za-z0-9-_]+.[A-Za-z0-9-_:%&~?/.=]+/g, function(url) {
return url.link(url);
});
};
String.prototype.parseUsername = function() {
return this.replace(/[@]+[A-Za-z0-9-_]+/g, function(u) {
var username = u.replace("@","")
return u.link("https://twitter.com/"+username);
@chriswgerber
chriswgerber / config
Last active February 13, 2018 13:36
SSH Config
Host bitbucket.org
ControlMaster no
Host *
Compression yes
ControlMaster auto
ControlPath /tmp/ssh-conn-%r@%h:%p.con
ControlPersist 30
ForwardAgent yes
ServerAliveInterval 100
IdentityFile ~/.ssh/id_rsa
@AndrewKvalheim
AndrewKvalheim / monokai.sh
Created August 31, 2012 20:22
Monokai color scheme for mintty
#!/bin/bash
# Applies the Monokai color scheme to the current terminal session.
declare -A map0
map0=( [foreground ]='#F8F8F2' [background ]='#272822'
[cursor ]='#F8F8F0' [selection ]='#49483E'
[pink ]='#F92672' [green ]='#A6E22E'
[yellow ]='#E6DB74' [blue ]='#66D9EF'
[purple ]='#AE81FF' [orange ]='#FD971F'
[gray ]='#75715E' )
@gocanto
gocanto / .travis.yml
Last active September 29, 2018 08:06
MySQL 5.7 Travis CI configuration
language: php
php:
- 7.0
- 7.1
services:
- mysql
addons:
#
# Jekyll Generator for SCSS
#
# (File paths in this description relative to jekyll project root directory)
# Place this file in ./_plugins
# Place .scss files in ./_scss
# Compiles .scss files in ./_scss to .css files in whatever directory you indicated in your config
# Config file placed in ./_sass/config.rb
#
@mcanvar
mcanvar / regex_replace.sql
Created March 19, 2016 22:49
mysql regex replace function
DELIMITER $$
CREATE FUNCTION `regex_replace`(pattern VARCHAR(1000),replacement VARCHAR(1000),original VARCHAR(1000))
RETURNS VARCHAR(1000)
DETERMINISTIC
BEGIN
DECLARE temp VARCHAR(1000);
DECLARE ch VARCHAR(1);
DECLARE i INT;
SET i = 1;