Skip to content

Instantly share code, notes, and snippets.

View iturgeon's full-sized avatar
👻
The answer is YES

Ian Turgeon iturgeon

👻
The answer is YES
View GitHub Profile
@iturgeon
iturgeon / gist:7234067
Created October 30, 2013 14:57
Send a json post request with Curl
curl -i -H "Content-Type: application/json" -H "Accept: application/json" -X POST -d '{"person":{"name":"bob"}}' http://site.com
@iturgeon
iturgeon / gist:0ed799c2c099f9093705
Last active August 29, 2015 14:01
Git: Pull every git repository in a subdirectory
find . -type d -name .git -exec sh -c "cd \"{}\"/../ && pwd && git pull" \;
@iturgeon
iturgeon / gist:ee2cc3de414549d15636
Last active August 29, 2015 14:01
Materia: Run grunt package on all widgets in source directory
find source -type d -d 1 -exec basename {} \; | xargs -I % -n 1 grunt package --widget=%
@iturgeon
iturgeon / gist:dd52bc877314bca87000
Created May 17, 2014 01:26
Materia: install every .wigt package at once
find static -name *.wigt | xargs -I % -n 1 php oil r widget:install % -u -f
var properties = [
{
"name":"Fish Hatchery Road",
"permalink":"Fish-Hatchery-Road",
"price":"$375,000",
"address":"998 Fish Hatchery Rd Lakeland, Fl 33801",
"description":"Once you step onto this property, you start to dream of the possibilities; from its size - 81 total acres- of which 45 are beautiful upland pastures and woodlands, its picturesque makeup, its location adjacent to Saddle Creek Park to its favorable Land Use designation, this property intrigues.",
"lot_size":"45 AC",
"land_use":"Leisure/Recreation (LR)",
"lake_frontage":"6,820' of dynamic shoreline - Saddle Creek Park",
@iturgeon
iturgeon / gist:4588221fc687008aed7f
Created August 12, 2014 23:39
Possible FuelPHP routing solution for dealing with 500s
<?
try
{
$response = Request::forge()->execute()->response();
}
catch (Exception $e)
{
$errorMap = [
'HttpNotFoundException' => '_404_',
@iturgeon
iturgeon / the same thing.rb
Last active August 29, 2015 14:08
playing with blocks
def js(*files)
content_for(:js) { javascript_include_tag(*files.map { |file| "/assets/js/#{file}"}) }
content_for(:js) do
javascript_include_tag(*files.map { |file| "/assets/js/#{file}"})
end
content_for(:js) do
derp = Proc.new { |file| "/assets/js/#{file}"}
javascript_include_tag *files.map(&derp)
@iturgeon
iturgeon / BatchQuery.php
Last active August 29, 2015 14:10
FuelPHP Batch insert Class
<?
/**
* BatchQuery allows you to do mass mysql inserts easily and quickly
*/
class BatchQuery
{
private $db;
private $batchSize = 0;
private $batchLimit = 200;
### Keybase proof
I hereby claim:
* I am iturgeon on github.
* I am iturgeon (https://keybase.io/iturgeon) on keybase.
* I have a public key whose fingerprint is 7932 3DB4 2863 FE6C EAAD 7428 13E1 B683 23C5 069E
To claim this, I am signing this object:
@iturgeon
iturgeon / README.md
Last active October 30, 2023 14:06
How to run phpMyAdmin using the built in php webserver

Running phpMyAdmin localy on the built in php server

  1. make sure you have php 5.3+: run php -v
  2. Download phpmyadmin (github or main website)
  3. In the root directory, copy config.sample.inc.php > config.inc.php
  4. Edit config.inc.php, set $cfg['Servers'][$i]['host'] to the ip address of your mysql server (probably localhost or 127.0.0.1)
  5. In the root phpmyadmin directory run php -S localhost:8080
  6. open in your browser: http://localhost:8080
  7. log in by entering some valid credentials (a user you added or the root user)