Skip to content

Instantly share code, notes, and snippets.

@tim-peterson
tim-peterson / ApplicationsMNPPconfnginxsites-enableddefault
Created September 13, 2012 03:25
MNPP /Applications/MNPP/conf/nginx/sites-enabled/default file
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root /Applications/MNPP/Library/nginx/html;
@tim-peterson
tim-peterson / ApplicationsMNPPconfnginxnginx.conf
Created September 13, 2012 03:26
MNPP /Applications/MNPP/conf/nginx/nginx.conf
user www;
worker_processes 5;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
@tim-peterson
tim-peterson / mysql.users
Created September 13, 2012 16:54
mysql.users
mysql> SELECT User,Host FROM mysql.user;
+------------------+------------------+
| User | Host |
+------------------+------------------+
| root | % |
| timrpeterson | % |
| root | 10.249.72.90 |
| root | 127.0.0.1 |
| root | 127.0.0.1:81 |
Event log
08:45:12 debug Pusher : Event recd : {"event":"pusher:pong","data":{}}
08:45:12 debug Pusher : Event sent : {"event":"pusher:ping","data":{}}
08:43:12 debug Pusher : No callbacks on presence-channel for pusher:subscription_succeeded
08:43:12 debug Pusher : Event recd : {"event":"pusher_internal:subscription_succeeded","data":{"presence":{"count":1,"ids":["669"],"hash":{"669":null}}},"channel":"presence-channel"}
08:43:11 debug Pusher : Event sent : {"event":"pusher:subscribe","data":{"auth":"22364f2f790269bec0a0:61ea01fc007fe6402acf54726b1ded67baedbeae3778bfc5b81da23b3189761b","channel_data":"{\"user_id\":669}","channel":"presence-channel"}}
08:43:08 status connected
08:43:08 debug Pusher : State changed : connecting -> connected
08:43:08 debug Pusher : Connecting : {"transport":"ws","url":"ws://ws.pusherapp.com:80/app/22364f2f790269bec0a0?protocol=7&client=js&version=3.0.0&flash=false"}
@tim-peterson
tim-peterson / gist:cdb81efba18665181d34
Created October 20, 2015 12:56
Firefox 40.0.3 test.pusher.com Tim Peterson
Event log
08:54:53 debug Pusher : Event recd : {"event":"pusher:pong","data":{}}
08:54:53 debug Pusher : Event sent : {"event":"pusher:ping","data":{}}
08:52:54 debug Pusher : No callbacks on presence-channel for pusher:subscription_error
08:52:54 debug Pusher : Couldn't get auth info from your webapp : 0
08:52:48 status connected
08:52:48 debug Pusher : State changed : connecting -> connected
08:52:47 debug Pusher : Connecting : {"transport":"ws","url":"ws://ws.pusherapp.com:80/app/22364f2f790269bec0a0?protocol=7&client=js&version=3.0.0&flash=false"}
08:52:47 status connecting
@tim-peterson
tim-peterson / docViewer requested via AJAX
Last active December 10, 2015 14:39
Using Crocodoc docViewer with AJAX vs. full-page load
<!--AJAX: this HTML generates a crocodoc if it is accessed via an AJAX request on another page---------------------->
<!--jQuery-->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
<!--docviewer.js-->
<script src="//static-v2.crocodoc.com/core/docviewer.js"></script>
<!--div for viewer-->
<div id="DocViewer"></div>
@tim-peterson
tim-peterson / pjax testing
Created January 28, 2013 23:31
pjax testing
pjax testing details
@tim-peterson
tim-peterson / Dwolla json_decode $_POST
Last active December 11, 2015 23:08
Dwolla json_decode $_POST
$file = 'application/views/dwolla/post.php';
// Open the file to get existing content
$current = file_get_contents($file);
$date=date("Y-m-d H:i:s");
$post=json_decode(file_get_contents('php://input'), TRUE);
if($post){
// Append a new person to the file
foreach($post as $key=>$value) {
$current .= "$key: $value\n";
}
@tim-peterson
tim-peterson / US State full name => two-digit abbrev conversion
Created February 1, 2013 21:23
Match state by its full name and return the two digit abbreviation (PHP)
$state='Massachusetts';
$state=ucfirst($state);
$states=array('AK' => 'Alaska', 'AL' => 'Alabama', 'AR' => 'Arkansas', 'AZ' => 'Arizona', 'CA' => 'California', 'CO' => 'Colorado', 'CT' => 'Connecticut', 'DE' => 'Delaware', 'DC' => 'District of Columbia', 'FL' => 'Florida', 'GA' => 'Georgia', 'HI' => 'Hawaii', 'IA' => 'Iowa', 'ID' => 'Idaho', 'IL' => 'Illinois', 'IN' => 'Indiana', 'KS' => 'Kansas', 'KY' => 'Kentucky', 'LA' => 'Louisiana', 'MA' => 'Massachusetts', 'MD' => 'Maryland', 'ME' => 'Maine', 'MI' => 'Michigan', 'MN' => 'Minnesota', 'MS' => 'Mississippi', 'MO' => 'Missouri', 'MT' => 'Montana', 'NC' => 'North Carolina', 'ND' => 'North Dakota', 'NE' => 'Nebraska', 'NH' => 'New Hampshire', 'NJ' => 'New Jersey', 'NM' => 'New Mexico', 'NV' => 'Nevada', 'NY' => 'New York', 'OH' => 'Ohio', 'OK' => 'Oklahoma', 'OR' => 'Oregon', 'PA' => 'Pennsylvania', 'RI' => 'Rhode Island', 'SC' => 'South Carolina', 'SD' => 'South Dakota', 'TN' => 'Tennessee', 'TX' => 'Texas', 'UT' => 'Utah', 'VA' => 'Virginia', 'VT' => 'V
@tim-peterson
tim-peterson / gist:5005643
Created February 21, 2013 15:52
Update node using n

n repo

node_modules TimPeterson$ npm install -g n
node_modules TimPeterson$ node -v
v0.4.12
node_modules TimPeterson$ n latest
node_modules TimPeterson$ node -v
v0.9.10