Skip to content

Instantly share code, notes, and snippets.

@remyzv
remyzv / prod.rb
Created February 15, 2016 14:51
Capifony recipe
server 'monserver.com', :app, :web, :primary => true
set :application, "MonProjet"
set :domain, "monserver.com"
set :user, "root"
set :deploy_to, "/home/monprojet"
set :app_path, "app"
set :web_path, "web"
set :repository, "git@bitbucket.org:monprojet.git"
@remyzv
remyzv / Makefile.sh
Created July 17, 2015 11:58
Make file for project with composer/bower/node
CONSOLE=app/console
install:
@ echo "Install composer"
@ curl -sS https://getcomposer.org/installer | php -- --install-dir=bin
@ echo "\nInstall composer dependencies"
@ php bin/composer.phar install
@ echo "\nInstall bower dependencies"
@remyzv
remyzv / Base.html.twig
Created July 15, 2015 09:02
Base template for FlatLab
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<link rel="shortcut icon" href="img/favicon.png">
<title>ReflexOccaz - Administration</title>
@remyzv
remyzv / gist:36d017c526172c5bb972
Created July 3, 2015 09:26
WP - Dans la meme categorie - Request
$args = array(
'post_type' => 'objectif_nutrition',
'posts_per_page' => -1,
'post__not_in' => array($post_id),
'orderby' => 'rand',
'post_parent' => $parent_id
);
$loop = new WP_Query( $args );
@remyzv
remyzv / Gulpfile
Created February 20, 2015 08:54
Simple Gulpfile with bourbon
var gulp = require('gulp'),
sass = require('gulp-sass'),
bourbon = require('node-bourbon'),
watch = require('gulp-watch');
var paths = {
scss: './scss/*'
};
@mixin media($point) {
@if $point == mobile {
@media screen and (max-width : em(768)) { @content ; }
}
@else if $point == tablet {
@media screen and (max-width : em(992)) and (min-width: em(768)) { @content ; }
}
@else if $point == laptop {
@media screen and (max-width : em(1200)) and (min-width: em(992)) { @content ; }
}
@remyzv
remyzv / slugify
Last active August 29, 2015 14:04
Slug a string with js
function slugify (value) {
var rExps=[
{re:/[\xC0-\xC6]/g, ch:'A'},
{re:/[\xE0-\xE6]/g, ch:'a'},
{re:/[\xC8-\xCB]/g, ch:'E'},
{re:/[\xE8-\xEB]/g, ch:'e'},
{re:/[\xCC-\xCF]/g, ch:'I'},
{re:/[\xEC-\xEF]/g, ch:'i'},
{re:/[\xD2-\xD6]/g, ch:'O'},
{re:/[\xF2-\xF6]/g, ch:'o'},
@remyzv
remyzv / capistrano
Created June 13, 2014 08:48
Capistrano cmd lines
desc "Database link"
task :bd_link do
on roles(:all) do |host|
within release_path do
execute :ln, '-s', "#{shared_path}/database.php", 'app/Config/database.php'
execute :rm, '-fr', 'app/Config/core.php'
execute :ln, '-s', "#{shared_path}/core.php", 'app/Config/core.php'
execute :rm, '-fr', 'app/webroot/files'
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% block title %}{% endblock %}</title>
<link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}" />
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css" />
@remyzv
remyzv / centerabsolute
Created May 28, 2014 13:16
Center an absolute div
.logo-header {
position:absolute;
left:50%;
}
.logo-header img {
position:relative;
left:-50%;
}