Skip to content

Instantly share code, notes, and snippets.

View natanfelles's full-sized avatar
💥
Hunting bugs! Follow me.

Natan Felles natanfelles

💥
Hunting bugs! Follow me.
View GitHub Profile
@natanfelles
natanfelles / config.json
Created April 2, 2016 10:46 — forked from anonymous/config.json
Bootstrap Customizer Config
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#e04028, 6.5%)",
"@brand-success": "#5cb85c",
@natanfelles
natanfelles / backup.sh
Last active May 22, 2017 06:14
Backup specific directories to external disk
#!/bin/bash
# Backup specific directories to external disk
# Created by Natan Felles
# Install rsync to do this script work. Execute "apt-get install rsync" in Debian distros
# To discover the UUID of the external disk, use gnome-disks ou execute "blkid"
# Do not forget to configure the variables LOGDIR, LOGFILE, DIRS and UUID
# Local log dir path
LOGDIR=/var/log/backup/
@natanfelles
natanfelles / domain.tld.conf
Last active May 12, 2024 03:51
Nginx Virtual Host example to work on localhost
# Location: /etc/nginx/sites-available/domain.tld.conf
server {
listen 80;
# listen 443 ssl;
# include snippets/snakeoil.conf;
root /var/www/domain.tld/public;
index index.html index.php;
@natanfelles
natanfelles / config
Last active June 5, 2016 16:19
Terminator Settings
# Location: ~/.config/terminator/config
# Numix Dark
[global_config]
title_hide_sizetext = True
hide_from_taskbar = True
suppress_multiple_term_dialog = True
handle_size = 3
tab_position = hidden
[keybindings]
[profiles]
@natanfelles
natanfelles / disable_startup
Last active May 23, 2016 22:17
LEMP install on Debian distros
update-rc.d -f nginx disable;
update-rc.d -f php5-fpm disable;
update-rc.d -f mysql disable;
update-rc.d -f memcached disable;
update-rc.d -f fcgiwrap disable;
@natanfelles
natanfelles / packages
Last active July 12, 2016 05:58
Debian packages
# Alguns softwares, como google-earth e steam, necessitam da arquitetura i386
# dpkg --add-architecture i386
firmware-linux-free
firmware-linux-nonfree
firmware-realtek
terminator
vim-nox
.gist {
color: #000;
}
.gist div {
padding: 0;
margin: 0;
}
.gist .gist-file {
@natanfelles
natanfelles / Embedding-Gist.htm
Created May 25, 2016 21:57 — forked from DinoChiesa/Embedding-Gist.htm
Embed a Gist using jQuery.
<link href="http://yandex.st/highlightjs/7.0/styles/default.min.css" rel="stylesheet">
<script src="http://yandex.st/highlightjs/7.0/highlight.min.js"></script>
<script type='text/javascript'> $(document).ready(function() {
function fixup(s) {
var re1 = new RegExp('<','g'), re2 = new RegExp('>','g');
return s.replace(re1,'&lt;').replace(re2,'&gt;');
}
$.ajax({type: "GET",
url: "https://api.github.com/gists/5617520",
@natanfelles
natanfelles / Compress HTML output.md
Last active March 1, 2018 11:25
Editing Compress HTML output

Source: https://github.com/bcit-ci/CodeIgniter/wiki/Compress-HTML-output

To remove useless whitespace from generated HTML, except for Javascript see [Regex Source] or just replace the $re value:

$re = '%# Collapse ws everywhere but in blacklisted elements.
        (?>             # Match all whitespaces other than single space.
          [^\S ]\s*     # Either one [\t\r\n\f\v] and zero or more ws,
        | \s{2,}        # or two or more consecutive-any-whitespace.
        ) # Note: The remaining regex consumes no text at all...