Skip to content

Instantly share code, notes, and snippets.

Avatar
🚀

Dan Bruder danbruder

🚀
View GitHub Profile
@danbruder
danbruder / migration_add_metadata_to_orders.sql
Created Feb 15, 2019
Store JSON blob in Postgres with Diesel
View migration_add_metadata_to_orders.sql
ALTER TABLE orders
ADD COLUMN meta_data jsonb;
View keybase.md

Keybase proof

I hereby claim:

  • I am danbruder on github.
  • I am danbruder (https://keybase.io/danbruder) on keybase.
  • I have a public key whose fingerprint is F9BC 547A 06E0 C1AB 182E A30B 26BD 915D EA14 63B5

To claim this, I am signing this object:

@danbruder
danbruder / selenium-install.sh
Last active Aug 29, 2015
Install Selenium Server on OSX
View selenium-install.sh
#!/bin/sh
run () {
RELEASE="2.44"
PREFIX="/usr/local/lib"
JAR_URL="http://selenium-release.storage.googleapis.com/${RELEASE}/selenium-server-standalone-${RELEASE}.0.jar"
PLIST_URL="https://gist.githubusercontent.com/danbruder/f64930d278d999a0d0e7/raw/4b9792774a4d91b22745b6679a42677bded153d3/selenium.plist"
# Unload running process
if launchctl list | grep -q "selenium"; then
@danbruder
danbruder / full.php
Last active Dec 22, 2015
Programmatically adding a field collection item to a node
View full.php
<?php
function my_function_name_add_image_to_field_collection($nid, $fid){
// Load target node
$node = node_load($nid);
// Create a new field collection
$field_collection_item = entity_create('field_collection_item', array('field_name' => 'my_field_collection_item_name'));
// Prepare link field
$link = array(
View adding_a_node_programatically.php
<?php
$results = db_select("old_table", "w")
->fields('w')
->execute();