Skip to content

Instantly share code, notes, and snippets.

View luizcanet's full-sized avatar

Luiz Henrique Canet Filho luizcanet

  • Rio de Janeiro, Brazil
View GitHub Profile
@luizcanet
luizcanet / eclipse.desktop
Created July 30, 2014 17:30
Ubuntu Shortcut: Eclipse
[Desktop Entry]
Name=Eclipse
Type=Application
Exec=env UBUNTU_MENUPROXY=0 /opt/eclipse/eclipse
Terminal=false
Icon=/opt/eclipse/icon.xpm
Comment=Integrated Development Environment
NoDisplay=false
Categories=Development;IDE
@luizcanet
luizcanet / sublime_text.desktop
Last active August 29, 2015 14:04
Ubuntu Shortcut: Sublime Text
[Desktop Entry]
Version=2
Name=Sublime Text
Comment=Sublime Text is a sophisticated text editor for code, markup and prose.
Exec=/usr/bin/sublime_text %f
Icon=/opt/sublime_text/Icon/128x128/sublime_text.png
Terminal=false
Type=Application
Categories=Development;IDE
X-Ayatana-Desktop-Shortcuts=NewWindow
@luizcanet
luizcanet / convert
Created September 3, 2014 13:59
ImageMagick Commands
# Resize to width if larger renaming for 001.jpg to 999.jpg standard.
convert *.jpeg -resize 82\> -scene 001 ../ed140/pageflipdata/pages/thumbnails/%03d.jpg
convert *.jpeg -resize 750\> -scene 001 ../ed140/pageflipdata/pages/%03d.jpg
@luizcanet
luizcanet / rename
Created September 4, 2014 19:30
Linux Commands
# Rename 1.jpg to 001.jpg
rename 's/\d+/sprintf("%03d",$&)/e' *
@luizcanet
luizcanet / behance.php
Last active December 30, 2017 20:23
Portifolio from Behance
<?php
$get = 'http://www.behance.net/v2/users/luizcanet/projects?api_key=4p1K31fR0mB3h4Nc3Th1Sd0NtW0rKs';
$portifolio = json_decode(file_get_contents($get));
?>
<?php if ($portifolio->http_code = 200) : ?>
<?php foreach ($portifolio->projects as $project) : ?>
<article class="project">
<a href="<?php print $project->url; ?>" target="_blank">
<h1><?php print $project->name; ?></h1>
<img src="<?php print $project->covers->{404}; ?>" alt="Project Image" />
@luizcanet
luizcanet / drupal.conf
Last active September 3, 2015 01:26
Drupal 8 Nginx Config
server {
listen 80; # redundant in new nginx versions
server_name yourserver.com www.yourserver.com;
root /usr/share/nginx/www/drupal;
access_log off;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
location ~ \..*/.*\.php$ {
return 403;
@luizcanet
luizcanet / nginx-drupal8
Last active December 17, 2015 20:56
NGINX conf for Drupal 8
server {
server_name [[DOMAIN]]; ## Ex.: example.com www.example.com
root [[ROOT_PATH]]; ## <-- Your only path reference. Ex. : /var/www/drupal8
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
@luizcanet
luizcanet / Dockerfile
Last active December 18, 2015 02:21
Debian + NGINX + PHP-FPM + MariaDB + Composer + Drush for Drupal 8 in Docker
FROM debian
MAINTAINER Luiz Henrique Canet Filho <luiz.henrique@fisqua.com>
RUN apt-get update && apt-get upgrade -y
RUN export DEBIAN_FRONTEND=noninteractive && apt-get update && apt-get install -y vim curl git exim4 nginx mariadb-server php5-fpm php5-mysql php5-gd php5-curl libssh2-php
RUN curl -sS https://getcomposer.org/installer | php
RUN mv composer.phar /usr/local/bin/composer
RUN curl https://gist.githubusercontent.com/luizcanet/145cf37f5043cd78e244/raw/0875197f0d69235ba47256466980315facd92529/nginx-drupal8 > /etc/nginx/sites-available/drupal8-template
RUN apt-get update && apt-get install -y php5-dev
RUN composer global require twig/twig:~1.0
RUN cd ~/.composer/vendor/twig/twig/ext/twig && phpize && ./configure && make && make install
@luizcanet
luizcanet / bling.js
Created August 26, 2017 17:33 — forked from paulirish/bling.js
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
@luizcanet
luizcanet / es-carousel-markup.html
Created August 16, 2018 20:54
ECMAScript Carousel Markup Example