Skip to content

Instantly share code, notes, and snippets.

@kraigh
kraigh / bower.json
Last active August 29, 2015 14:23 — forked from ericlbarnes/bower.json
{
"name": "project",
"version": "0.0.0",
"authors": [
"Eric Barnes <me@example.org>"
],
"license": "MIT",
"private": true,
"ignore": [
"**/.*",
@kraigh
kraigh / github-pr.sh
Created May 21, 2015 20:48
github pull request helper
#!/usr/bin/env bash
branch=$(git symbolic-ref --short HEAD)
remote=$(git config --get remote.origin.url)
url=${remote/git\@github\.com\:/https://github.com/}
url=${url/\.git/\/compare/}
base=
while getopts b: opt; do
case $opt in
b)
if (strpos($message, ' ') === false) {
throw new UnexpectedValueException('Cannot split a 160+ char text message without spaces, WTF');
}
// Titanium Mobile code for slider control functionality
//----------------------------------------
// @CJ_Reed 23rd Dec 2010
var sliderView = Titanium.UI.createView({top:100,height:50,left: 40,width:240,backgroundColor:'#000'});
var sliderButton = Titanium.UI.createView({width:96,borderRadius:5,backgroundColor:'#bbb',height:sliderView.height,left:sliderView.left,top:sliderView.top});
Titanium.UI.currentWindow.add(sliderView);
Titanium.UI.currentWindow.add(sliderButton);
function unlock (){
{if $master_ride->notes|escape}
<p class="notes">{$master_ride->notes}</p>
{/if}
@kraigh
kraigh / newoffice.md
Last active August 29, 2015 14:03
New Office

Kraig's list of Upsides/Downsides for the new office

Downsides

  • 50% smaller cubes for sr. developers
  • 50% more bland overall color scheme
  • 100% less fountains
  • 95% fewer food options
  • Its friggen cold

Upsides

@kraigh
kraigh / gist:dd85531d7958f7822046
Created April 30, 2014 13:25
production merge
$ git merge ZIMEHI-137-vanpool-import
Auto-merging v3/application/configuration/config.ini
Merge made by the 'recursive' strategy.
v3/application/configuration/config.ini | 2 +-
.../default/controllers/AdminController.php | 52 ++++++-
.../default/views/university/layouts/footer.tpl | 8 +-
.../university/scripts/admin/bookingmanagement.tpl | 97 ++++++++---
.../views/university/scripts/booking/book.tpl | 8 +-
.../university/scripts/booking/driverresponse.tpl | 11 ++
.../university/scripts/onetimebookings/new.tpl | 2 +-
@kraigh
kraigh / test.php
Last active August 29, 2015 14:00
<?php
if (function_exists($function)) {
$context = array_merge($context, $params);
$actions_result[$action_id] = $function($object, $context, $a1, $a2);
}
else {
$actions_result[$action_id] = FALSE;
}
?>
function field_collection_field_widget_embed_validate($element, &$form_state, $complete_form) {
$instance = field_widget_instance($element, $form_state);
$field = field_widget_field($element, $form_state);
$field_parents = $element['#field_parents'];
$field_name = $element['#field_name'];
$language = $element['#language'];
$field_state = field_form_get_state($field_parents, $field_name, $language, $form_state);
dpm('LETS SEE IF THIS SHIT EXISTS');
dpm('$form_state');
dpm($form_state);
$fax_fc = entity_create('field_collection_item', array('field_name' => 'field_fax'));
$fax_fc->setHostEntity('commerce_customer_profile', $profile);
$fax_fc_wrapper = entity_metadata_wrapper('field_collection_item', $fax_fc);
$fax_fc_wrapper->field_telephone_country_code->set($account_details['faxCountryCode']);
$fax_fc_wrapper->field_phone_fax_number->set($account_details['faxNumber']);
$fax_fc_wrapper->field_extension_code->set($account_details['faxExtension']);
$fax_fc_wrapper->save(true);
$phone_fc = entity_create('field_collection_item', array('field_name' => 'field_phone'));