Thanks @MichaelAllenClark for the help with his examples. Not sure why this info wasn't on the code.exacttarget.com website to begin with.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I have marked with a * those which I think are absolutely essential | |
Items for each section are sorted by oldest to newest. Come back soon for more! | |
BASH | |
* In bash, 'ctrl-r' searches your command history as you type | |
- Input from the commandline as if it were a file by replacing | |
'command < file.in' with 'command <<< "some input text"' | |
- '^' is a sed-like operator to replace chars from last command | |
'ls docs; ^docs^web^' is equal to 'ls web'. The second argument can be empty. | |
* '!!:n' selects the nth argument of the last command, and '!$' the last arg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# useful for rails server already running message | |
lsof -wni tcp:3000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* API Request Caching | |
* | |
* Use server-side caching to store API request's as JSON at a set | |
* interval, rather than each pageload. | |
* | |
* @arg Argument description and usage info | |
*/ |
Below is a collection of links and tools used in my day to day life as a creative developer. There are a few stages of this from Frontend, Middleware, Database, Creative, DevOps and General Tools. This is intended to be a living document of these resources.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$date = date("Y-m-dTH:i:s"); | |
$file = 'db.backup.' . $date . '.sql.gz'; | |
error_log("Database Backup Started - " . $file); | |
exec('touch ' . $file); | |
exec('chmod 600 ' . $file); | |
exec('mysqldump -u user --password="password" --add-drop-table --single-transaction database_name | gzip > ' . $file); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
## Your website name goes here. | |
server_name domainname.com www.domainname.com _; | |
## Your only path reference. | |
root /var/www/; | |
listen 8080; | |
## This should be in your http block and if it is, it's not needed here. | |
index index.html index.htm index.php; | |
include conf.d/drop; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var App = App || {}; | |
App.Helpers = App.Helpers || {}; | |
(function($) { | |
'use strict'; | |
App.Helpers.Numbers = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ini_set('auto_detect_line_endings',TRUE); | |
$handle = fopen("mydata.csv", "r"); | |
?> | |
<ul> | |
<?php while ( ($data = fgetcsv($handle, 1000, ",")) !== FALSE ): ?> | |
<li> | |
<a href="<?= $data[4] ?>" class="product-container"> | |
<img class="lazy" src="<?= $data[3] ?>" data-original="<?= $data[3] ?>"> | |
<div class="post-details"> |