Skip to content

Instantly share code, notes, and snippets.

Genar Trias Ortiz gtrias

Block or report user

Report or block gtrias

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View install_gems_system_wide.sh
sudo gem install --no-user-install sass
@gtrias
gtrias / README.md
Created Nov 3, 2015 — forked from chriswessels/README.md
A guide to setting up self-hosted infrastructure for Meteor applications on Ubuntu Server 13.04.
View README.md

#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 Sep 14, 2015 — forked from ZeBigDuck/AddFulltextIndexesCommand.php
MATCH AGAINST for Doctrine DQL queries
View AddFulltextIndexesCommand.php
<?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 Sep 8, 2015 — forked from mikeemoo/routing.yml
Catch all routing symfony2
View routing.yml
LowpressWordpressBundle_homepage:
pattern: /{url}
defaults: { _controller: LowpressWordpressBundle:Default:index }
requirements:
url: ".*"
@gtrias
gtrias / handlebars.striptags.js
Last active Aug 29, 2015 — forked from tracend/handlebars.striptags.js
striptags() #handlebars #helper #cc
View handlebars.striptags.js
// 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 Aug 29, 2015
Git search for files
View git_search_files.sh
# 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 / fromGit2Svn.sh
Last active Aug 29, 2015
Push existing git repository to existing svn repository
View fromGit2Svn.sh
# 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 / sslredirect.conf
Created Jul 28, 2015
Apache redirect to HTTPS
View sslredirect.conf
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 / cake3ORMMatching.php
Created Jul 27, 2015
Cakephp3 - Retrieve entity based on related entity conditions
View cake3ORMMatching.php
<?php
...
$this->loadModel('Posts');
$posts = $this->Posts
->find('all')
->limit(6)
->contain([
'Filed.Files',
'Filed.Thumbs',
You can’t perform that action at this time.