Skip to content

Instantly share code, notes, and snippets.

View SammyK's full-sized avatar
🐶
Meredith Palmer Memorial Celebrity Rabies Awareness ProAm FunRun Race 4 The Cure

Sammy Kaye Powers SammyK

🐶
Meredith Palmer Memorial Celebrity Rabies Awareness ProAm FunRun Race 4 The Cure
View GitHub Profile
@dariodiaz
dariodiaz / CleverLink.php
Created February 17, 2014 20:02
php laravel: macro to change current active link
var Style = React.createClass({
render: function() {
var style = assign({}, this.props);
delete style.children;
return React.createElement(
'div',
{style: style, children: this.props.children}
);
}
@hikari-no-yume
hikari-no-yume / config-bare.sh
Created February 11, 2015 03:06
PHP config scripts that I use
#!/bin/sh
make clean
./vcsclean
./buildconf
YACC=/usr/local/opt/bison27/bin/bison ./configure --enable-debug --enable-phpdbg "$@"
@dcousineau
dcousineau / app.js
Last active August 29, 2015 14:19
How to initialize cookies for Safari when your app lives in an Iframe
import cookie from 'cookie-cutter';
App.on('before:start', () => {
//Safari does not respect P3P policies by default and blocks all 3rd party cookies (which is what our cookie is when
//loaded in an Iframe). To work around this we need to open a window to our application and set the cookies then
//close it. Safari allows us to interact with cookies that have already been set (but not create new ones).
if (cookie.get('expected_cookie') === undefined) {
//However, Safari (like all browsers) puts the kibosh on all windows that open without user interaction!
//Therefore we intercept all clicks to open the short-lived window that initializes all of our cookies.
$(document.body).one('click', '[data-goto]', e => {
@labbati
labbati / local-build.sh
Last active January 25, 2019 14:18
Build packages for dd-trace
#!/usr/bin/env bash
rm -rf extensions
mkdir -p extensions
rm -rf build/packages
mkdir -p build/packages
function build_version() {
PHP_VERSION=$1
@nateware
nateware / gist:3997958
Created November 2, 2012 00:53
Cheat sheet to create auto-scaling group behind ELB
  1. Create the appropriate VPC that your application is going to live in. Create subnets for each availability zone you want to use.

  2. Create VPC security group(s) for your auto-scaling instances. For example, if you're going to auto-scale web servers, create a "web" VPC security group.

  3. Go into AWS console and create an ELB. Easy wizard. Select HTTP and (if needed) HTTPS. Make sure it's associated with the VPC you created in step 1.

  4. Create an auto-scaling launch configuration from the CLI. The launch configuration has the AMI, size, and security group from step #2. The security group must be by ID not name ("sg-12345"):

       as-create-launch-config web --image-id ami-2e31bf1e --instance-type m1.medium \
    

-g sg-7619041a --key root

@fideloper
fideloper / Gettable.php
Created March 9, 2014 19:33
Trait for making protected/private attributes "gettable", leaving "setting" the attributes a matter of business logic to be implemented.
<?php
trait Gettable {
/**
* Retrieve private attributes.
* Attributes should be protected
* so they cannot be *set* arbitrarily.
* This allows us to *get* them as if they
* were public.
@blazarecki
blazarecki / PopupDictionary.php
Last active November 10, 2021 15:54
Alert, confirm and prompt with mink
<?php
namespace Widop\Mink\Extension;
/**
* Dictionary to manage popups.
*
* @author Benjamin Lazarecki <benjamin.lazarecki@gmail.com>
*/
trait PopupDictionary
@tlberglund
tlberglund / git-loglive
Last active January 12, 2024 03:40
Log Live Git Command
#!/bin/bash
while :
do
clear
git --no-pager log --graph --pretty=oneline --abbrev-commit --decorate --all $*
sleep 1
done