Skip to content

Instantly share code, notes, and snippets.

View dwolfhub's full-sized avatar

Daniel Wolf dwolfhub

View GitHub Profile
@dwolfhub
dwolfhub / transfer_ssm_file.sh
Last active March 19, 2024 20:36 — forked from lukeplausin/transfer_ssm_file.sh
Transfer a file to EC2 SSM instance without using S3 (SSM only)
npm run build-storybook
tar --create --gzip --file storybook.tar.gz storybook-static
INSTANCE_ID=X
# export AWS
# Tab 2:
# < Start session
aws ssm start-session --target $INSTANCE_ID
cd ~
@dwolfhub
dwolfhub / xdebug-install.sh
Last active May 16, 2017 15:06
Install the latest xdebug for php 7.1 in ubuntu 16 vagrant box with configuration for phpstorm debugging
#!/usr/bin/env bash
cd ~
git clone git://github.com/xdebug/xdebug.git
cd xdebug
phpize
./configure --enable-xdebug
make
sudo make install
@dwolfhub
dwolfhub / keybase.md
Last active August 29, 2015 14:20
keybase.md

Keybase proof

I hereby claim:

  • I am dwolfhub on github.
  • I am wolfbase (https://keybase.io/wolfbase) on keybase.
  • I have a public key whose fingerprint is 2FEE AF9D 86CC EE56 6292 EBD2 36A6 3B70 1F8A 664E

To claim this, I am signing this object:

@dwolfhub
dwolfhub / optimal-nginx-ssl
Created January 20, 2015 05:00
Optimal SSL configuration for Nginx
server {
server_name www.example.com;
listen 443;
ssl on;
ssl_certificate /path/to/ssl-bundle.crt;
ssl_certificate_key /path/to/private.key;
ssl_session_timeout 5m;
ssl_prefer_server_ciphers On;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS;
@dwolfhub
dwolfhub / index.php
Last active August 29, 2015 14:13
Bolt index.php with environment config support
<?php
require_once "../vendor/autoload.php";
$configuration = new Bolt\Configuration\Composer(dirname(__DIR__));
$configuration->setPath("web", "public_html");
$configuration->setPath("files", "public_html/files");
$configuration->setPath("themebase", "public_html/theme");
$applicationEnv = getenv('APPLICATION_ENV');
if ($applicationEnv and is_dir('app/config/' . $applicationEnv)) {
@dwolfhub
dwolfhub / Chatter.php
Created April 24, 2014 20:52
Chatter MessageComponentInterface implementation
<?php
namespace Chatter;
use Ratchet\MessageComponentInterface;
use Ratchet\ConnectionInterface;
class Chatter implements MessageComponentInterface {
@dwolfhub
dwolfhub / app.php
Created April 23, 2014 16:06
Chatter web server code using ratchet
<?php
use Ratchet\Server\IoServer;
use Ratchet\Http\HttpServer;
use Ratchet\WebSocket\WsServer;
use Chatter\Chatter;
require 'vendor/autoload.php';
$server = IoServer::factory(
@dwolfhub
dwolfhub / ga.pageviews.js
Created April 19, 2014 23:19
Simple Google Analytics page view tracking in AngularJS
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXXX-X']);
_gaq.push(['_gat._forceSSL']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
@dwolfhub
dwolfhub / gist:6309392
Created August 22, 2013 16:16
PHP: Detect AJAX
if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) AND strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest') {
// I'm AJAX!
}
@dwolfhub
dwolfhub / gist:5783517
Created June 14, 2013 16:55
PHP: Fuel model boilerplate
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Model_names_model extends Base_module_model {
function __construct()
{
parent::__construct('table_name');
}
}