Skip to content

Instantly share code, notes, and snippets.

@gtrias
gtrias / sslredirect.conf
Created July 28, 2015 10:57
Apache redirect to HTTPS
NameVirtualHost *:80
<VirtualHost *:80>
ServerName www.example.com
Redirect permanent / https://secure.example.com/
</VirtualHost>
<VirtualHost _default_:443>
ServerName secure.example.com
DocumentRoot /usr/local/apache2/htdocs
SSLEngine On
@gtrias
gtrias / fromGit2Svn.sh
Last active August 29, 2015 14:26
Push existing git repository to existing svn repository
# Clone the svn repository
$ git svn clone http://svn.example.com/project/trunk # Important to clone the trunk folder
$ cd trunk
$ git checkout -b mywork
$ git pull /path/to/current/work/repository/.git master
#Merge and "push"
$ git checkout master
@gtrias
gtrias / go_all_dependencies.sh
Created July 29, 2015 14:48
Install all go dependencies
go get .
@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 / 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 / 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 / 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 / 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 / install_gems_system_wide.sh
Created November 6, 2015 11:03
Install gems system wide
sudo gem install --no-user-install sass
@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();
});
})