Skip to content

Instantly share code, notes, and snippets.

View tcelestino's full-sized avatar
🙃

Tiago Celestino tcelestino

🙃
View GitHub Profile
@tcelestino
tcelestino / ssl.sh
Last active November 2, 2017 16:50
3 steps to create a ssl certificate on macOS from localhost
cd; mkdir .ssl
openssl req -newkey rsa:2048 -x509 -nodes -keyout .ssl/localhost.key -new -out .ssl/localhost.crt -subj /CN=localhost -reqexts SAN -extensions SAN -config <(cat /System/Library/OpenSSL/openssl.cnf <(printf '[SAN]\nsubjectAltName=DNS:localhost')) -sha256 -days 3650
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain .ssl/localhost.crt
@tcelestino
tcelestino / localtunnel.sh
Created June 27, 2017 12:02
restart's localtunnel when it is stop
function localtunnel {
lt -s subdomain --port port_number
}
until localtunnel; do
echo "localtunnel server crashed"
sleep 2
done
@tcelestino
tcelestino / fb-curl-messenger.txt
Last active July 4, 2022 01:22
curl to Facebook's APIs
curl -X POST -H "Content-Type: application/json" -d '{
"setting_type":"call_to_actions",
"thread_state":"new_thread",
"call_to_actions":[
{
"payload":"Greeting"
}
]
}' "https://graph.facebook.com/v2.9/me/thread_settings?access_token=PAGE_ACCESS_TOKEN"
@tcelestino
tcelestino / freewifi.sh
Created June 1, 2017 02:46
Get free wifi - based in Remy Sharp's post: https://remysharp.com/2017/05/29/getting-free-wifi
alias freewifi="sudo ifconfig en0 ether `openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'`"
@tcelestino
tcelestino / geolocation-global-callback.html
Created October 14, 2016 02:33
Geolocation callback example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Geolocation Example</title>
</head>
<body>
<script>
(function() {
@tcelestino
tcelestino / architeture-sass
Last active June 19, 2016 22:40
based in post article Hugo Giraudel on SitePoint. http://www.sitepoint.com/architecture-sass-project/
sass/
|
|– base/
| |– _reset.scss # Reset/normalize
| |– _typography.scss # Typography rules
| ... # Etc…
|
|– components/
| |– _buttons.scss # Buttons
| |– _carousel.scss # Carousel

Font Face

A mixin for writing @font-face rules in SASS.

Usage

Create a font face rule. Embedded OpenType, WOFF2, WOFF, TrueType, and SVG files are automatically sourced.

@include font-face(Samplino, fonts/Samplino);
#breadcrumbs li:before {
content: "\00BB";
}
@tcelestino
tcelestino / getAll.js
Created March 13, 2016 16:19
get all data localStorage
var i = 0,
oJson = {},
sKey;
for (; sKey = window.localStorage.key(i); i++) {
oJson[sKey] = window.localStorage.getItem(sKey);
}
console.log(oJson);
@tcelestino
tcelestino / gist:295ad4e63b2dfaf4ea89
Created March 10, 2016 17:27
Fix The (Annoying) ‘Failed to Fetch’ Chrome apt Error
sudo sed -i -e 's/deb http/deb [arch=amd64] http/' "/etc/apt/sources.list.d/google-chrome.list"
sudo sed -i -e 's/deb http/deb [arch=amd64] http/' "/opt/google/chrome/cron/google-chrome"