Skip to content

Instantly share code, notes, and snippets.

View djbobbydrake's full-sized avatar

Chhay Chhun djbobbydrake

View GitHub Profile
@djbobbydrake
djbobbydrake / upgrade-node.md
Last active March 6, 2018 04:30
Upgrading node, yarn, pm2
@djbobbydrake
djbobbydrake / laravel-codeship.md
Created March 7, 2017 18:28
Setting up Laravel on Codeship
# We support all major PHP versions. Please see our docs for a full list
# https://documentation.codeship.com/classic/languages-frameworks/php/
phpenv local 7.0
echo "memory_limit = 512M" >> /home/rof/.phpenv/versions/$(phpenv version-name)/etc/php.ini
# install dependencies
COMPOSER_HOME=${HOME}/cache/composer
composer install --prefer-dist --no-interaction
# set up environment variables
touch .env
@djbobbydrake
djbobbydrake / caravel_setup.md
Last active July 14, 2016 21:29
Installing Caravel
  1. brew install pkg-config libffi openssl python
  2. sudo python setup.py develop — got error "error: Flask-SQLAlchemy 2.1 is installed but Flask-SQLAlchemy==2.0 is required by set(['flask-appbuilder'])"
  3. sudo pip install Flask-SQLAlchemy==2.0
  4. Rerun sudo python setup.py develop
  5. Continue with steps from https://github.com/kidspass/caravel/blob/master/CONTRIBUTING.md

Setup the assets

  1. cd /caravel/assets
  2. npm install
@djbobbydrake
djbobbydrake / install-node.sh
Created July 11, 2016 19:21
Install node
#!/bin/bash
# Predefined links and files. Note: LTS may not be latest LTS
export NODE_STABLE=http://nodejs.org/dist/node-latest.tar.gz
export NODE_LTS=https://nodejs.org/dist/latest-v4.x/node-v4.2.2.tar.gz
export RC_BASH=~/.bashrc
export RC_PROFILE=~/.profile
# Settings
export NODE_VER=$NODE_LTS
@djbobbydrake
djbobbydrake / setup.md
Last active July 19, 2016 22:29
Setting up Ubuntu + Nginx + PM2

Update ubuntu and install nginx

  1. sudo apt-get update
  2. sudo apt-get upgrade
  3. sudo apt-get install htop git python-software-properties curl libm17n-0 rcconf dialog graphicsmagick build-essential openssl libssl-dev libpcre3 libpcre3-dev zlib1g-dev
  4. sudo apt-get install libgoogle-perftools-dev google-perftools
  5. wget http://nginx.org/download/nginx-1.10.1.tar.gz
  6. tar zxvf nginx-1.10.1.tar.gz
  7. rm nginx-1.10.1.tar.gz
  8. cd nginx-1.10.1
@djbobbydrake
djbobbydrake / php-notices.md
Last active August 29, 2015 14:20
PHP notices

Hi everyone,

Yesterday, I merged in a branch to re-enable PHP notices in our development environments and to fix quite a few of them (I've updated more than 80 files in the process). I committed a few follow-up branches to fix broken tests. As it currently stands, I believe I've fixed all of the selenium tests, but I can't tell, because the test runner is currently blocked by a few jobs on bigmac. I also can't tell if simpletest is red or green, because I can't access Hudson (it's after hours, so couldn't get Mike to whitelist my IP). I may be blocking you from merging tomorrow, but please don't merge until the tests are resolved. I believe the effort will be worth the benefits. PHP notices have been disabled for quite a long time in our dev environments. I believe that re-enabling PHP notices should lead to much better quality code and result in fewer bugs. As part of our development process, we should keep an eye on two log files where the PHP notices will appear.

  1. /var/log/drupal.log
  2. /var/lo
@djbobbydrake
djbobbydrake / gist:0587ec0c8de8b2e618b5
Created February 2, 2015 19:25
vagrant vm salt failures
local:
----------
ID: epel
Function: pkgrepo.managed
Result: True
Comment: Package repo 'epel' already configured
Started: 14:04:16.994102
Duration: 13.078 ms
Changes:
----------
<!-- simple-todos.html -->
<head>
<title>Todo List The Real Deal</title>
</head>
<body>
<div class="container">
<header>
<h1>Todo List</h1>
<!-- add a form below the h1 -->
@djbobbydrake
djbobbydrake / speare-json
Last active August 29, 2015 14:09
Testing Speare - json
{"title":"What the narwhal's tusk is really for","content":"<p>EVER since Europeans began trading the whorled ivory tusk of the narwhal in the 12th century,&nbsp;people have puzzled over its purpose. Early research was hampered by the widespread myth that the tusk came from the head of a unicorn. Its supposed magic properties made it a prized item:&nbsp;Queen Elizabeth I bought one for &#163;10,000, the price of a castle. Yet even after it was firmly established that the tusk was the left-front tooth of the narwhal, an Arctic whale unappealingly named the \"corpse whale\" by Scandinavians because of its mottled colouring (<em>nar<\/em> means corpse and <em>hvalr<\/em> means whale in Old Norse), conjecture continued as to why a whale would have developed such an appendage. What is its purpose?<\/p><p>Herman Melville, the author of \"Moby Dick\", joked that the tusk, which can grow close to three metres in length, was a letter opener. Charles Darwin thought it had something to do with sexual selection, because
@djbobbydrake
djbobbydrake / mobile detect regex
Created October 9, 2014 16:20
mobile detect regex
\biPhone.*Mobile|\biPod|BlackBerry|\bBB10\b|rim[0-9]+|HTC|HTC.*(Sensation|Evo|Vision|Explorer|6800|8100|8900|A7272|S510e|C110e|Legend|Desire|T8282)|APX515CKT|Qtek9090|APA9292KT|HD_mini|Sensation.*Z710e|PG86100|Z715e|Desire.*(A8181|HD)|ADR6200|ADR6400L|ADR6425|001HT|Inspire 4G|Android.*\bEVO\b|T-Mobile G1|Z520m|Nexus One|Nexus S|Galaxy.*Nexus|Android.*Nexus.*Mobile|Dell.*Streak|Dell.*Aero|Dell.*Venue|DELL.*Venue Pro|Dell Flash|Dell Smoke|Dell Mini 3iX|XCD28|XCD35|\b001DL\b|\b101DL\b|\bGS01\b|Motorola|DROIDX|DROID BIONIC|\bDroid\b.*Build|Android.*Xoom|HRI39|MOT-|A1260|A1680|A555|A853|A855|A953|A955|A956|Motorola.*ELECTRIFY|Motorola.*i1|i867|i940|MB200|MB300|MB501|MB502|MB508|MB511|MB520|MB525|MB526|MB611|MB612|MB632|MB810|MB855|MB860|MB861|MB865|MB870|ME501|ME502|ME511|ME525|ME600|ME632|ME722|ME811|ME860|ME863|ME865|MT620|MT710|MT716|MT720|MT810|MT870|MT917|Motorola.*TITANIUM|WX435|WX445|XT300|XT301|XT311|XT316|XT317|XT319|XT320|XT390|XT502|XT530|XT531|XT532|XT535|XT603|XT610|XT611|XT615|XT681|XT701|XT702|XT711