Skip to content

Instantly share code, notes, and snippets.

View rek's full-sized avatar
🏋️

adam tombleson rek

🏋️
  • CNTXT
  • Riyadh, Saudi Arabia
View GitHub Profile
@rek
rek / apc_make_commands
Last active August 29, 2015 13:56
Compile APC extension for apache2
wget http://pecl.php.net/get/APC-3.1.13.tgz
tar xvzf APC-3.1.13.tgz
cd APC-3.1.13
/usr/local/bin/phpize-5.4
./configure --with-php-config=/usr/local/php54/bin/php-config
make
cp modules/apc.so ~/.php/5.4/
rm -Rf APC-3.1.13
@rek
rek / androiddeploy.sh
Last active August 29, 2015 13:57
Cordova - Android APK Deploy to Production
#!/bin/bash
PROJECTNAME="myproject"
KEYREPO="prod"
echo -e '\n======================================================='
echo "# APK Builder for Play Store deployment #"
echo '======================================================='
echo ' '
read -p "Are you sure you want to do this? [y/n] " -r
echo # (optional) move to a new line
@rek
rek / id_rsa.pub
Created May 2, 2014 01:51
My public key (mrek)
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDNDqa06FRAviHixBZOJJR0EMzTx3zrFU6elIu4S3aWUImM3RWiy6jqkIGcygX1QBvgJr1949jWVqp7KdWXF26uXDoo5Akq6W3Av4CC0VXgswg+4bJbYZL7KvgHh3KXJculhs1n6yr13oVi7o/e0Um64ggNu7S4Pin1e1Z17bycLzmQDnRFN428dF0btxo153RJMTGlhE9v1HteRbhfQwSsuw7HVRMGyZEZeSXWX6nObeDAVqh5S8EKXZZUBIYIZpP8HTwbG541rDYxUtQZO/d+wR2vwy+/OSLIcpRBe305Nm6vsIRR8l6bfJBmuI1UBn4D3n7ccOJAY8Qna/WYZNRH
@rek
rek / gist:f18a7e38b8e4e3686584
Created September 4, 2014 06:26
Dust.js Cheatsheet
{?cond}
cond is true
{:else}
cond is not true
{/cond}
{^cond}
cond is false
{:else}
cond is not false
@rek
rek / gist:f3ac813b498ce7523e6b
Last active August 27, 2019 10:30
GIT CHEATSHEET

==== Ohhh did you FORGETS yeS? ====

save passwords for 10 hours

git config --global credential.helper cache

git config credential.helper 'cache --timeout=36000'

BRANCHES (checkout https://github.com/rek/devconfig too now):

to see what branches exist and which one we are on

git branch -v

@rek
rek / Close function
Created July 15, 2015 09:57
Sublime Text - Snippits
<snippet>
<content><![CDATA[
});
]]></content>
<tabTrigger>w</tabTrigger>
<description>Close callback function: });</description>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.javascript</scope> -->
</snippet>
@rek
rek / Controller.js
Created December 24, 2015 05:04
Backbone model state system
var view = new View({
state: state, // <- state
)};
state.set({
action: 'myFunction',
data: {
awesome: true
}
});
@rek
rek / Postgres
Last active August 6, 2016 11:56
Start:
sudo su - postgres
psql
By default, postgres tries to connect to a database with the same name as your user.
To prevent this default behaviour, just specify user and database:
psql -U Username DatabaseName
To check if running:
sudo service postgresql status
@rek
rek / utils.js
Created August 17, 2016 14:32
PostgreSQL Insert Helper - Javascript
import _ from 'lodash'
let inserter = (table, items) => {
let validKeys = _.keys(items).join(', '),
countKeys = _.reduce(items, (results) => {
results.push('$' + (results.length + 1))
return results
}, []).join(', '),
data = _.values(items)
@rek
rek / retag.sh
Created November 15, 2016 06:08
Auto Git Re-Tag a branch
#!/bin/bash
echo ''
echo '--------------------------'
echo "--RE-TAGGING: ${1}"
echo '--------------------------'
echo ''
git tag -d ${1}
git push origin :refs/tags/${1}