Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Loving Open Source

Avtandil Kikabidze akalongman

:octocat:
Loving Open Source
View GitHub Profile
@akalongman
akalongman / gist:9108753
Last active Aug 29, 2015
Nested check function
View gist:9108753
public function diagnosticTree()
{
$errors = array();
$this->_lock();
// Test 0
$sql = ' SELECT MIN(`left_key`) '
View sublime_text_useful_shortcuts.md

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods
@akalongman
akalongman / copy
Created Mar 7, 2014
Copy folder recursively
View copy
$path = 'path/to/src';
$dest = 'path/to/dest';
foreach (
$iterator = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::SKIP_DOTS),
RecursiveIteratorIterator::SELF_FIRST) as $item
) {
if ($item->isDir()) {
mkdir($dest . DIRECTORY_SEPARATOR . $iterator->getSubPathName());
View build.gradle
android {
signingConfigs {
release
}
buildTypes {
release {
signingConfig signingConfigs.release
}
View genymotionwithplay.txt
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
Google Apps for Android 4.4.4 (https://www.androidfilehost.com/?fid=23501681358544845 - gapps-kk-20140606-signed.zip)
Google Apps for Android 4.3 (https://www.androidfilehost.com/?fid=23060877490000124 - gapps-jb-20130813-signed.zip)
Google Apps for Android 4.2 (https://www.androidfilehost.com/?fid=23060877490000128 - gapps-jb-20130812-signed.zip)
Google Apps for Android 4.1 (https://www.androidfilehost.com/?fid=22979706399755082 - gapps-jb-20121011-signed.zip)
@akalongman
akalongman / build.gradle
Created Mar 20, 2015
Android build.gradle example
View build.gradle
apply plugin: 'com.android.application'
def getBuildDate() {
def date = new Date()
def formattedDate = date.format("yyyy-MM-dd'T'HH:mm:ss'Z'")
return formattedDate
}
def BUILD_DATE = getBuildDate()
android {
@akalongman
akalongman / underscore_to_camelcase
Created Jun 1, 2015
Regexp for converting underscore methods to CamelCase for Sublime Text
View underscore_to_camelcase
Search: function (\w+)_(\w)
Replace: function $1\U$2\E
If underscores is more then one, you can run this replace multiple time
View gulpfile.json
var gulp = require('gulp');
var minifyCss = require('gulp-minify-css');
var gulpConcat = require('gulp-concat');
var uglify = require('gulp-uglify');
var notify = require('gulp-notify');
var cssFiles = [
'public_html/res/css/bootstrap.css',
'public_html/res/css/datetimepicker.css',
'public_html/res/css/datepicker.css',
@akalongman
akalongman / reset.css
Created Dec 16, 2013
Reset CSS file to browser defaults
View reset.css
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,