Skip to content

Instantly share code, notes, and snippets.

View Spoygg's full-sized avatar

Ivan Ivanić Spoygg

View GitHub Profile
@Spoygg
Spoygg / IE7 inline-block block
Created April 26, 2012 06:30
IE7 hack to mimic inline-block on block elements
/* IE7 hack to mimic inline-block on block elements */
*display: inline;
*zoom: 1;
@Spoygg
Spoygg / Mencoder add .ass subs
Created April 26, 2012 06:35
Mencoder add .ass subs to mp4, output to avi
mencoder movie.mp4 -sub subtitle.ssa -vf fixpts=fps=30000/1001,ass,fixpts -ass -o movie.avi -oac mp3lame -ovc lavc -lavcopts vbitrate=1200
@Spoygg
Spoygg / Bash completion for git-checkout alias
Created April 26, 2012 06:36
Adding git-checkout completion to alias co
complete -F _git_checkout co
@Spoygg
Spoygg / Exuberants
Created April 26, 2012 06:37
Creating exuberant ctags file for vim tags
ctags-exuberant -f tags -h ".php.js.scss.html" -R --exclude="\.git" --totals=yes --tag-relative=yes --PHP-kinds=+cf --regex-PHP='/abstract class ([^ ]*)/\1/c/' --regex-PHP='/interface ([^ ]*)/\1/c/' --regex-PHP='/(public |static |abstract |protected |private )+function ([^ (]*)/\2/f/'
@Spoygg
Spoygg / Seč development git note
Created April 26, 2012 06:38
Do not place in gitconfig
autocrlf = input
autocrlf = true
@Spoygg
Spoygg / WP num of queries
Created April 26, 2012 06:41
Check number of queries made for WP page
<?php echo $wpdb->num_queries; ?> <?php _e('queries'); ?>. <?php timer_stop(1); ?> <?php _e('seconds'); ?>
@Spoygg
Spoygg / Vim kill blank lines
Created April 30, 2012 07:43
Delete all blank lines from file
:g/^$/d
sudo gpasswd -a $USER www-data
@Spoygg
Spoygg / pull that embed out
Created May 31, 2012 17:38
Deleting embedded document from document, MongoDB shell with $pull
> use test_database
> var pu = db.Profileusers
> pu.find({"blocks.title":""}).toArray() // find in Profileusers collection all profile users that have a block which title is empty
[
{
"_id" : ObjectId("4fc73221c0cd99aba79c7b74"),
"blocks" : [
{
"_id" : ObjectId("4fc78936376ab08618000000"),
"title" : "", // <-- here is the incriminating element, it's gonna fly muaaahaaaaaaa-ha-ha-ha (evil_grin)
...
providers:
document_provider:
id: some_nice_handle_that_strikes_your_fancy
...