Skip to content

Instantly share code, notes, and snippets.

@choiceforyou
choiceforyou / deploy.sh
Last active August 29, 2015 14:09 — forked from BFTrick/deploy.sh
#! /bin/bash
# A modification of Dean Clatworthy's deploy script as found here: https://github.com/deanc/wordpress-plugin-git-svn
# The difference is that this script lives in the plugin's git repo & doesn't require an existing SVN repo.
# main config
PLUGINSLUG="______your-plugin-name______"
CURRENTDIR=`pwd`
MAINFILE="______your-plugin-name______.php" # this should be the name of your main php file in the wordpress plugin
# git config
@choiceforyou
choiceforyou / Composer
Created June 15, 2014 08:24
Composer Commands
composer.phar require doctrine/doctrine-fixtures-bundle:2.1.*@dev
composer.phar update doctrine/doctrine-fixtures-bundle
@choiceforyou
choiceforyou / config
Created May 14, 2014 17:28 — forked from kimchy/config
Elasticsearch case insensitive field
index:
analysis:
analyzer:
string_lowercase:
tokenizer: keyword
filter: lowercase
@choiceforyou
choiceforyou / Notes
Created February 1, 2014 07:23
Tricks for improving iPhone UITableView scrolling performance
Cache the height of the rows (the table view can request this frequently)
Create a least-recently-used cache for the images used in the table (and invalidate all the inactive entries when you receive a memory warning)
Draw everything in the UITableViewCell's drawRect: if possible avoid subviews at all costs (or if you require the standard accessibility functionality, the content view's drawRect:)
Make your UITableViewCell's layer opaque (same goes for the content view if you have one)
Use the reusableCellIdentifier functionality as recommended by the UITableView examples/documentation
Avoid gradients/complicated graphical effects that aren't pre-baked into UIImages
If you're using images, make sure you're caching them so you don't have to load from file more than once for each (if you have the memory -- you'd be surprised how much space images take up).
Make as many elements opaque as possible. Similarly, try not and use images with transparency.

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@choiceforyou
choiceforyou / git_installation.sh
Created April 19, 2013 16:37
CentOS Git installation To install git client on CentOS you have to run these commands:
yum install gettext-devel expat-devel curl-devel zlib-devel openssl-devel
cd /usr/local/src
wget http://kernel.org/pub/software/scm/git/git-1.7.0.tar.gz
tar xzvf git-1.7.0.tar.gz
cd git-1.7.0
make prefix=/usr/local all
make prefix=/usr/local install
@choiceforyou
choiceforyou / es.sh
Created March 25, 2013 19:47 — forked from rajraj/es.sh
cd ~
sudo yum update
sudo yum install java-1.7.0-openjdk.i686 -y
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.9.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
mv elasticsearch-* elasticsearch
sudo mv elasticsearch /usr/local/share