Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Lucas Freitas lucasff

🎯
Focusing
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
*/
angular.module('ttmApp')
@lucasff
lucasff / dumpoverssh.sh
Created Oct 10, 2015 — forked from kirkegaard/dumpoverssh.sh
pipe a mysql dump through gzip and send it over ssh
View dumpoverssh.sh
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;
$(".riddle-animate").click(function(e){
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
ink.removeClass("animate");
@lucasff
lucasff / index.html
Created Aug 27, 2014
Welcome page ISPConfig
View index.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Welcome!</title>
<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
lucasff / .htaccess
Created Aug 27, 2014
monster .htaccess
View .htaccess
# Apache configuration file
# httpd.apache.org/docs/2.2/mod/quickreference.html
# Note .htaccess files are an overhead, this logic should be in your Apache
# config if possible: httpd.apache.org/docs/2.2/howto/htaccess.html
# Techniques in here adapted from all over, including:
# Kroc Camen: camendesign.com/.htaccess
# perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/
# Sample .htaccess file of CMS MODx: modxcms.com
@lucasff
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 @ digwp.com
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");
?>
<!DOCTYPE HTML>
<html dir="ltr" lang="en-US">
View gist:3618d7f5c54b5d3b5482
intitle:"Index of" "themeforest-2833226-avada-responsive-multipurpose-theme.zip"
@lucasff
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
lucasff / default.html
Last active Aug 29, 2015
cPanel defaults
View default.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<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.