Skip to content

Instantly share code, notes, and snippets.

View tcelestino's full-sized avatar

Tiago Celestino tcelestino

View GitHub Profile
@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"
@tcelestino
tcelestino / detect-global.js
Created July 28, 2015 12:03
Detecting var globals. Create by Remy Sharp
(function (global) {
function Globals () {}
var getWindow = function () {
var iframe = document.createElement('iframe')
iframe.style.display = 'none'
document.body.appendChild(iframe)
var result = iframe.contentWindow || iframe.contentDocument
@tcelestino
tcelestino / tplSettings.md
Last active August 29, 2015 14:25 — forked from dre3s/my.js.underscore.tpl.settings.md
UnderscoreJs - Template Settings

UnderscoreJs - Template Settings

  var templateHtml = this.$el.html(),                                                                              |      <span class="item-duration">{{= item.duration }}</p>                                  
  content = {                                                                                                      |      </a>                                                                                  
    item: this.item.attributes                                                                                     |      <div class="item-info">                                                               
  },                                                                                                               |        <p class="item-sectionName">                                                        
  tplSetting = {                                                                                                   |          <a href="{{= item.se