Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am brycefisher on github.
* I am bff (https://keybase.io/bff) on keybase.
* I have a public key whose fingerprint is C5B5 A620 A9FE 0471 0B82 C3DE 7164 981B 336A 2F68
To claim this, I am signing this object:
echo "BOOTSTRAP: Update apt-get"
sudo apt-get update -y
echo "BOOTSTRAP: Install some utilities"
sudo apt-get install -y curl git
echo "BOOTSTRAP: Install FFMPEG"
sudo apt-get install -y ffmpeg
echo "BOOTSTRAP: Install mysql server"
@brycefisher
brycefisher / alrt.js
Created May 29, 2014 19:58
google xss
alert()
@brycefisher
brycefisher / update-rust.sh
Created April 28, 2014 15:25
Update Rust Compiler
#!/bin/sh
curl http://static.rust-lang.org/dist/rust-nightly-x86_64-unknown-linux-gnu.tar.gz >> rust-nightly.tar.gz
tar xvf rust-nightly.tar.gz
cd rust-nightly-x86_64-unknown-linux-gnu
./install.sh
cd ..
rm -rf rust-nightly-x86_64-unknown-linux-gnu
rm rust-nightly.tar.gz
@brycefisher
brycefisher / convert.php
Created March 27, 2014 04:30
Extracts a several of fields that were put into the same cell and outputs a CSV
<?php
// Open the munged file
$in_fp = fopen('CarenChengWordList.csv','r');
while ($row = fgetcsv($in_fp)) {
// Separate out the data in the 3rd column into 3 fields
list($messy_fields, $sentence) = explode("\n", $row[2]);
$period_index = stripos($messy_fields, '.');
$part_of_speech = substr($messy_fields, 0, $period_index);
$definition = substr($messy_fields, $period_index + 1);
@brycefisher
brycefisher / bash-output.txt
Created March 21, 2014 19:25
neovim/neovim manual build output
$ make cmake
rm -rf build
make -C src/testdir clean
rm -rf *.out *.failed *.rej *.orig test.log test.out X* viminfo tiny.vim small.vim mbyte.vim mzscheme.vim lua.vim test.ok valgrind.*
make -C test/includes clean
rm -rf post
sh -e scripts/setup-test-tools.sh
Checking Lua includes...
lua.h found in /Users/bfisher-fleig/Desktop/neovim/.deps/usr/include/luajit-2.0/lua.h
curl found at /usr/bin
@brycefisher
brycefisher / settings.php
Created November 12, 2013 16:55
How to Retrieve Environment Variables in Drupal settings.php
<?php
//...
// Store the database credentials serialized in an environmental variable.
$db_creds = unserialize(getenv('DRUPAL_DB_CRED'));
$databases = array (
'default' =>
array (
'default' => $db_creds,
@brycefisher
brycefisher / gist:7344428
Created November 6, 2013 21:29
Drupal6: Create dummy translations of all nodes in a content type via drush script
<?php
/**
* @file
* This is a drush script designed to create fake translations of the genera pages for development purposes ONLY.
*
* NOTE:
* -----
* This file must be located somewhere inside the drupal root.
*
* USAGE:
@brycefisher
brycefisher / gist:7328057
Created November 5, 2013 23:12
drupal - create arbitrary number of placeholders for a SQL injection resistant db_query() call
<?php
$nids = array(1, 2, 3, 4, 5);
// This is the key piece to understand -- it creates as many placeholder as you want based on the length of $nids array.
$placeholders = implode(',', array_fill(0, count($nids), '%d'));
$results = db_query("
select r.title
from {node_revisions} r
join {node} n
@brycefisher
brycefisher / gist:7030684
Created October 17, 2013 19:20
Create Related Partner Nodequeue
/**
* Create a nodequeue.
*/
function _brightcove_marketing_solutions_create_nodequeue() {
$nodequeue = new stdClass;
// $nodequeue->api_version = 2;
$nodequeue->name = 'marketing_solutions_related_partners';
$nodequeue->title = 'Marketing solutions - related partners';
$nodequeue->subqueue_title = '';
$nodequeue->size = 0;