Skip to content

Instantly share code, notes, and snippets.

@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
@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

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 / 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.
@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 / 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 / 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 / 2014-11-08 Composer Best Practices.html
Created November 24, 2014 22:54
Composer Best Practices by Jordi Boggiano
This file has been truncated, but you can view the full file.
<!DOCTYPE html>
<html><head><title>Composer Best Practices</title><meta name="author" content="Jordi Boggiano"><meta name="email" content="j.boggiano@seld.be"><meta name="date" content="2014-11-08"><meta name="venue" content="TrueNorthPHP 2014"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><!-- Slippy core file and dependencies --><script type="text/javascript">/*!
* jQuery JavaScript Library v1.5.1
* http://jquery.com/
*
* Copyright 2011, John Resig
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
@choiceforyou
choiceforyou / Putty commands
Created December 11, 2014 23:38
Putty commands
Export Sessions
regedit /e "%userprofile%\desktop\putty-registry.reg" HKEY_CURRENT_USER\Software\Simontatham
@choiceforyou
choiceforyou / Gitcheatsheet
Created December 16, 2014 22:32
Git Cheatsheet (copied)
Using Git
===============
Global Settings
-----------
Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/