Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@gtrias
gtrias / docker-clean.sh
Created January 10, 2016 22:16
Docker cleaning unused containers
docker rm `docker ps -a | grep Exited | awk '{print $1 }'`
docker rmi `docker images -aq`
@gtrias
gtrias / docker_get_host_ip.sh
Last active December 22, 2015 11:29
Get the docker host IP from a container
# Source http://stackoverflow.com/questions/22944631/how-to-get-the-ip-address-of-the-docker-host-from-inside-a-docker-container
/sbin/ip route|awk '/default/ { print $3 }'
@gtrias
gtrias / ionic-load-screen-main.js
Created November 17, 2015 16:32
Ionic loading screen intercepting http calls
// Ionic loading page
.run(function ($rootScope, $ionicLoading) {
$rootScope.$on('loading:show', function() {
$ionicLoading.show({template: 'foo'});
});
$rootScope.$on('loading:hide', function() {
$ionicLoading.hide();
});
})
@gtrias
gtrias / install_gems_system_wide.sh
Created November 6, 2015 11:03
Install gems system wide
sudo gem install --no-user-install sass
@gtrias
gtrias / README.md
Created November 3, 2015 08:30 — forked from chriswessels/README.md
A guide to setting up self-hosted infrastructure for Meteor applications on Ubuntu Server 13.04.

#Meteor and Self-hosted Infrastructure

Meteor is an eye-opening JavaScript framework that runs on both the client and the server, giving developers a revolutionary take on software engineering. If you are not familiar with Meteor, I urge you to visit their website.

##An overview

In this brief gist, I am going to discuss the process of setting up a server (in my case, a VPS) to host Meteor applications.

My experience with Meteor has been brief, however it has not taken much demonstration for me to realise the significance of this stellar framework. Let's jump right in!

@gtrias
gtrias / AddFulltextIndexesCommand.php
Last active September 14, 2015 13:12 — forked from yobud/AddFulltextIndexesCommand.php
MATCH AGAINST for Doctrine DQL queries
<?php
# xxx/yyyBundle/Command/AddFulltextIndexesCommand.php
/**
* AddFulltextIndexesCommand.php
*
* @author Jérémy Hubert <jeremy.hubert@infogroom.fr>
* @since lun. 26 sept. 2011 09:23:53
*/
namespace xxx\yyyBundle\Command;
@gtrias
gtrias / routing.yml
Last active September 8, 2015 15:27 — forked from mikeemoo/routing.yml
Catch all routing symfony2
LowpressWordpressBundle_homepage:
pattern: /{url}
defaults: { _controller: LowpressWordpressBundle:Default:index }
requirements:
url: ".*"
@gtrias
gtrias / handlebars.striptags.js
Last active August 29, 2015 14:28 — forked from tracend/handlebars.striptags.js
striptags() #handlebars #helper #cc
// This doesn't work for me
Handlebars.registerHelper("striptags", function( txt ){
// exit now if text is undefined
if(typeof txt == "undefined") return;
// the regular expresion
var regexp = new RegExp('#([^\\s]*)','g');
// replacing the text
return txt.replace(regexp, '');
});
@gtrias
gtrias / git_search_files.sh
Last active August 29, 2015 14:27
Git search for files
# Source: http://stackoverflow.com/questions/7203515/how-to-locate-a-deleted-file-in-the-commit-history
# Search for a file knowing the path
git log --all -- <path-to-file>
# Display the file on that sha
git show <SHA> -- <path-to-file>
# Restore file for that sha
git checkout <SHA> -- <path-to-file>
@gtrias
gtrias / go_all_dependencies.sh
Created July 29, 2015 14:48
Install all go dependencies
go get .