Skip to content

Instantly share code, notes, and snippets.


Lucas Freitas lucasff

Block or report user

Report or block lucasff

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 flatten.js
const flatten = (arr, result = []) => {
if (!Array.isArray(arr)){
return [...result, arr];
arr.forEach((elem) => {
result = flatten(elem, result)
return result
View syncHeight.js
'use strict';
* @ngdoc directive
* @name ttmApp.directive:CopyHeight
* @description
* Set the height of an element base on another element
lucasff /
Created Oct 10, 2015 — forked from kirkegaard/
pipe a mysql dump through gzip and send it over ssh
mysqldump -u MYSQL_USERNAME -p YOUR_DATABASE | gzip -c | ssh USERNAME@YOUR_TO_HOST 'cat > ~/dump.sql.gz'
View javascript.js
var parent, ink, d, x, y;
parent = $(this).parent();
//create .ink element if it doesn't exist
if(parent.find(".ink").length == 0)
parent.prepend("<span class='ink'></span>");
ink = parent.find(".ink");
//incase of quick double clicks stop the previous animation
lucasff / index.html
Created Aug 27, 2014
Welcome page ISPConfig
View index.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="" xml:lang="en" lang="en">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="shortcut icon" href="/favicon.ico" />
<meta name="robots" content="noindex" />
<style type="text/css"><!--
lucasff / .htaccess
Created Aug 27, 2014
monster .htaccess
View .htaccess
# Apache configuration file
# Note .htaccess files are an overhead, this logic should be in your Apache
# config if possible:
# Techniques in here adapted from all over, including:
# Kroc Camen:
# Sample .htaccess file of CMS MODx:
lucasff / db-error.php
Last active Aug 29, 2015
Perishable Press WordPress database error
View db-error.php
<?php // custom WordPress database error page tutorial @
header('HTTP/1.1 503 Service Temporarily Unavailable');
header('Status: 503 Service Temporarily Unavailable');
header('Retry-After: 3600'); // 1 hour = 3600 seconds
mail("spamless@domain.tld", "Database Error", "There is a problem with teh database!", "From: Montgomery Scott");
<html dir="ltr" lang="en-US">
View gist:3618d7f5c54b5d3b5482
intitle:"Index of" ""
lucasff / simple.dns
Last active Aug 29, 2015
cPanel custom defaults
View simple.dns
; cPanel %cpversion%
; Zone file for %domain%
$TTL %ttl%
@ %nsttl% IN SOA %nameserver%. %rpemail%. (
%serial% ; serial, todays date+todays
3600 ; refresh, seconds
600 ; retry, seconds
1209600 ; expire, seconds
3600 ; minimum, seconds
lucasff / default.html
Last active Aug 29, 2015
cPanel defaults
View default.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Default Web Site Page</title>
<style type="text/css">
body {font-family:arial;margin:0;padding:0;background:url(/img-sys/bg.jpg) repeat-x #dff4fe;color:#6f6f6f;font-size:12px;}
a {color:#0075a9;}
* {margin:0;padding:0;}
h1 {background:url(/img-sys/header.jpg) no-repeat; height:83px;text-indent:-9999px;}
You can’t perform that action at this time.