Skip to content

Instantly share code, notes, and snippets.

View Artistan's full-sized avatar

Charles Peterson Artistan

View GitHub Profile
@Artistan
Artistan / pagination.twig
Created March 13, 2014 02:49
Pagination
{#
You need the following variables:
paginationCurrentFilters: an associative array that contains the current settings of the page like search, filters, etc. For example {% set paginationCurrentFilters = { ‘search’: search, ‘filter_by_is_active’: filter_by_is_active } %}, so it can be easy for us to merge the pagination with these filters.
paginationCurrentPage : the current page you are in
paginationRouteName : the route name of the path that paginates files
paginationTotal : The paginationTotal number of pages (ceil(found_entities/items_per_page))
paginationLastPage : represents the paginationTotal number of existing pages
paginationExtremePagesLimit : the number of first and last pages to be displayed
paginationNearbyPagesLimit : the number of pages that are displayed around the active page
@Artistan
Artistan / lessWatch.sh
Created April 17, 2014 11:35
less compile
#!/bin/bash
while true;
do N=`find -name "*.less" `;
inotifywait -qe modify $N ;
for f in $N;
do lessc $f ${f%.*}.css;
done;
done;
@Artistan
Artistan / main.less.sh
Created April 17, 2014 11:37
main.css less compiler
#!/bin/bash
while true;
do N=`find -name "*.less" `;
inotifywait -qe modify $N ;
for f in $N;
do lessc main.less main.css;
done;
done;
@Artistan
Artistan / dabblet.css
Created February 21, 2015 19:40
Generate repeating hexagonal pattern with CSS3 (SO) - 1 element/ hexagon !!!
/**
* Generate repeating hexagonal pattern with CSS3 (SO) - 1 element/ hexagon !!!
* http://stackoverflow.com/q/10062887/1397351
*/
* { box-sizing: border-box; margin: 0; padding: 0; }
.row { margin: -18.5% 0; text-align: center; }
.row:first-child { margin-top: 2.25%; }
.hexagon {
position: relative;
display: inline-block;
@Artistan
Artistan / dabblet.css
Created February 21, 2015 19:40
Generate repeating hexagonal pattern with CSS3 (SO) - 1 element/ hexagon !!!
/**
* Generate repeating hexagonal pattern with CSS3 (SO) - 1 element/ hexagon !!!
* http://stackoverflow.com/q/10062887/1397351
*/
* { box-sizing: border-box; margin: 0; padding: 0; }
.row { margin: -18.5% 0; text-align: center; }
.row:first-child { margin-top: 2.25%; }
.hexagon {
position: relative;
display: inline-block;
@Artistan
Artistan / dabblet.css
Last active August 29, 2015 14:15
Generate repeating hexagonal pattern with CSS3 (SO) - 1 element/ hexagon !!!
/**
* Generate repeating hexagonal pattern with CSS3 (SO) - 1 element/ hexagon !!!
* http://stackoverflow.com/q/10062887/1397351
*/
* { box-sizing: border-box; margin: 0; padding: 0; }
.row:first-child { margin-top: 0%; }
.hexagon {
position: relative;
display: inline-block;
overflow: hidden;
@Artistan
Artistan / readme.md
Last active August 29, 2015 14:17 — forked from ashrithr/readme.md

Installing ELK (CentOS)

This is a short step-by-step guide on installing ElasticSearch LogStash and Kibana Stack on a CentOS environment to gather and analyze logs.

I. Install JDK

rpm -ivh https://dl.dropboxusercontent.com/u/5756075/jdk-7u45-linux-x64.rpm
@Artistan
Artistan / readme.md
Last active August 29, 2015 14:17 — forked from ashrithr/readme.md

Installing ELK (CentOS)

This is a short step-by-step guide on installing ElasticSearch LogStash and Kibana Stack on a CentOS environment to gather and analyze logs.

I. Install JDK

rpm -ivh https://dl.dropboxusercontent.com/u/5756075/jdk-7u45-linux-x64.rpm
@Artistan
Artistan / vpnsetup.sh
Last active August 29, 2015 14:26 — forked from hwdsl2/.MOVED.md
IPsec L2TP VPN Auto Install Script for Ubuntu 14.04 & 12.04 and Debian 8 & 7
#!/bin/sh
#
# Amazon EC2 user-data file for automatic configuration of IPsec/L2TP VPN server
# on a Ubuntu or Debian instance. Tested with Ubuntu 14.04 & 12.04 and Debian 8 & 7.
# With minor modifications, this script *can also be used* on dedicated servers
# or any KVM- or XEN-based Virtual Private Server (VPS) from other providers.
#
# DO NOT RUN THIS SCRIPT ON YOUR PC OR MAC! THIS IS MEANT TO BE RUN WHEN
# YOUR AMAZON EC2 INSTANCE STARTS!
#
@Artistan
Artistan / waitForKeyElements.js
Last active September 10, 2015 13:27 — forked from BrockA/waitForKeyElements.js
A utility function, for Greasemonkey scripts, that detects and handles AJAXed content.
/*--- waitForKeyElements(): A utility function, for Greasemonkey scripts,
that detects and handles AJAXed content.
Usage example:
waitForKeyElements (
"div.comments"
, commentCallbackFunction
);