Skip to content

Instantly share code, notes, and snippets.

View khushalbokadey's full-sized avatar

Khushal bokadey khushalbokadey

  • Bangalore, India
View GitHub Profile
@khushalbokadey
khushalbokadey / sample.sh
Created December 7, 2016 10:42
bash examples
## Get lines with image size greater than > 653x350
egrep -o '(6[5-9][0-9]|[7-9][0-9][0-9]|[0-9]{4})x(3[5-9][0-9]|[4-9][0-9][0-9]|[0-9]{4})' images-in-new-line | sort | wc -l
@khushalbokadey
khushalbokadey / slugify.js
Created December 1, 2016 09:31
Code to slugify text. Mainly to use in google sheets.
function slugify(value) {
/*
* Convert the the vs in a range of cells into slugs.
*/
slug = '';
slug = value.substring(0, 30).toLowerCase();
slug = slug.replace(/[^\w\s-]/g, '');
slug = slug.replace(/\s+/g, '-');
Logger.log(slug);
@khushalbokadey
khushalbokadey / create-csv.sh
Created August 29, 2016 11:21
Create CSVs from Mysql
mysql -uroot -p db -e "select * from table" | sed "s/\"//g;s/'/\'/;s/\t/\",\"/g;s/^/\"/;s/$/\"/;s/\n//g" > filename.csv
@khushalbokadey
khushalbokadey / sublime-codeformatter.js
Created August 29, 2016 11:18
Sublime Code formatter settings
{
"codeformatter_debug": false,
"codeformatter_php_options": {
"syntaxes": "php", // Syntax names which must process PHP formatter
"php_path": "", // Path for PHP executable, e.g. "/usr/lib/php" or "C:/Program Files/PHP/php.exe". If empty, uses command "php" from system environments
"format_on_save": false, // Format on save
"php55_compat": false, // PHP 5.5 compatible mode
"psr1": false, // Activate PSR1 style
"psr1_naming": false, // Activate PSR1 style - Section 3 and 4.3 - Class and method names case
@khushalbokadey
khushalbokadey / sublime-syntax-1.js
Last active August 29, 2016 11:16
Sublime Settings - Syntax Specific User
{
"word_wrap": true,
"index_files": false
}