Skip to content

Instantly share code, notes, and snippets.

View notbrain's full-sized avatar

Brian Ross notbrain

View GitHub Profile
@notbrain
notbrain / bgpink.sublime-snippet
Created November 14, 2012 00:50
background color pink sublime snippet
<snippet>
<content><![CDATA[
background-color: ${1:pink};
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>pink</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.less</scope> -->
</snippet>
<?php
class featureButtonSlotActions extends BaseaButtonSlotActions {
/**
* Image association is handled by a separate action
* @param sfRequest $request
* @return mixed
*/
public function executeImage(sfRequest $request)
{
@notbrain
notbrain / create_self_signed_cert.sh
Last active August 29, 2015 13:58
Script to create a self signed certificate with an existing server key. Single argument is FQDN of app.
#!/bin/sh
APP_NAME=$1
APPSSLPATH=/usr/local/etc/nginx/ssl/$APP_NAME;
sudo mkdir -p $APPSSLPATH && cd $APPSSLPATH;
# sudo /usr/bin/openssl req -new -key $KEY_FILEPATH -out $APPSSLPATH/$APP_NAME.csr && \
sudo openssl req -new -newkey rsa:2048 -nodes -out $APP_NAME.csr -keyout $APP_NAME.key -subj "/C=US/ST=California/L=San Francisco/O=Engineering Inc./CN=$APP_NAME" && \
@notbrain
notbrain / TwilightCustom.tmTheme
Last active August 29, 2015 14:05
Sublime Enhancements
<!--appended to default to work with bh_core.sublime-settings brackethighlighter.default style-->
<dict>
<key>name</key>
<string>Bracket Tag</string>
<key>scope</key>
<string>brackethighlighter.default</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#351501</string>
@notbrain
notbrain / USER-bh_core.sublime-settings
Created August 20, 2014 14:18
change brackethighlighter colors
{
"bracket_styles": {
"default": {
"icon": "dot",
// BH1's original default color for reference
// "color": "entity.name.class",
"color": "brackethighlighter.default",
"style": "highlight"
@notbrain
notbrain / nginx_logformat.conf
Last active August 29, 2015 14:08
Readable JSON nginx log format
log_format main '{\nrequest: "$request @ [$time_local]", \nremote_addr: "$remote_addr", \nremote_user: "$remote_user",'
'\nstatus: "$status", \nbody_bytes_sent: "$body_bytes_sent", \nhttp_referer: "$http_referer", '
'\nhttp_user_agent: "$http_user_agent", \nhttp_x_forwarded_for: "$http_x_forwarded_for"\n},';
@notbrain
notbrain / q.js
Created December 16, 2014 06:39
quick glance $q deferring of promise
var deferred = $q.defer();
$timeout(function() {
deferred.resolve('Hello!');
}, 1000);
return deferred.promise;
@notbrain
notbrain / mongod.conf.yml
Last active August 29, 2015 14:21
mongod yaml config file
storage:
dbPath: /var/lib/mongodb
journal:
enabled: true
systemLog:
destination: file
path: /var/log/mongodb/mongod.log
logAppend: true
logRotate: rename
@notbrain
notbrain / installinone.sh
Last active September 25, 2017 01:19
ubuntu 16.04 LTS mongodb_3.2 mariadb_10.1 nginx_ppa-stable nodejs_6 git build-essential all in one installer
#!/bin/bash
# all in one non-interactive runner
export DEBIAN_FRONTEND=noninteractive;
sudo DEBIAN_FRONTEND=noninteractive apt-get update -y;
sudo DEBIAN_FRONTEND=noninteractive apt-get upgrade -y;
# build-essential
sudo apt-get install -y build-essential;
@notbrain
notbrain / selfie-cert.sh
Last active November 5, 2015 03:24
Quick script for making self-signed certificates
#!/bin/sh
APP_NAME=$1
APPSSLPATH=/usr/local/etc/nginx/$APP_NAME;
sudo mkdir -p $APPSSLPATH && cd $APPSSLPATH;
sudo openssl req -new -newkey rsa:2048 -nodes -out $APP_NAME.csr -keyout $APP_NAME.key -subj "/C=US/ST=California/L=San Francisco/O=Engineering Inc./CN=$APP_NAME" && \
sudo /usr/bin/openssl x509 -req -days 1365 -in $APP_NAME.csr -signkey $APP_NAME.key -out $APP_NAME.crt;