Skip to content

Instantly share code, notes, and snippets.

View nantunes's full-sized avatar
🤔
...

Nelson Antunes nantunes

🤔
...
View GitHub Profile
@nsotnikov
nsotnikov / configuration.yaml
Last active November 18, 2020 10:30
Home Assistant - Tasmota
# Just an example how to check and upgrade the sonoff-tasmota from the Home Assistant: configuration.yaml
# One click upgrade all Sonoff-Tasmota devices, check the current installed and latest available version of firmware.
# Twitter link: https://goo.gl/e3y7pa
#
# 1. Open your sonoff webinterface and add in the "Firmware Upgrade" menu following OTA Url, save! Example: https://goo.gl/6ZMjzA
# OTA Url: http://sonoff.maddox.co.uk/tasmota/sonoff.bin
#
# 2. Below the Home Assistant configuration:
script:
@paulirish
paulirish / bling.js
Last active May 1, 2024 19:56
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
@ajaxray
ajaxray / 1_DocumentSerializer.php
Last active July 3, 2018 10:54
A simple PHP Trait to make Doctrine MongoDB ODM Documents serializable to Array or JSON
<?php
/**
* Created by PhpStorm.
* Author: Anis Ahmad <anisniit@gmail.com>
* Date: 5/11/14
* Time: 10:44 PM
*/
namespace Your\CoreBundle\Traits;
@cypres
cypres / install-folly.sh
Last active December 30, 2015 21:29
Canonical way to install https://github.com/facebook/folly on OS 10.9 (Mavericks)
#!/bin/bash
# Canonical way to install folly on OS 10.9 (Mavericks)
# For deps try: brew install boost glog gflags jemalloc scons autoconf automake libtool
git clone git@github.com:facebook/folly.git fb-folly
cd fb-folly
# Commit 79c25e6f4a breaks complilation on OS X, so checkout previous version
git checkout 6d89f3d33268eaa12d5eb03a4afa5caa856306c5
git clone https://code.google.com/p/double-conversion/
@bradmontgomery
bradmontgomery / install-comodo-ssl-cert-for-nginx.rst
Last active April 1, 2024 11:21
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@swankjesse
swankjesse / RetrofitCachingExample.java
Created June 29, 2013 03:03
Demonstrate HTTP caching with OkHttp and Retrofit.
/*
* Copyright (C) 2013 Square, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@james2doyle
james2doyle / scrollTo.js
Last active November 29, 2023 11:41
a native scrollTo function in javascript that uses requestAnimationFrame and easing for animation
// easing functions http://goo.gl/5HLl8
Math.easeInOutQuad = function (t, b, c, d) {
t /= d/2;
if (t < 1) {
return c/2*t*t + b
}
t--;
return -c/2 * (t*(t-2) - 1) + b;
};
@malarkey
malarkey / Contract Killer 3.md
Last active May 13, 2024 13:18
The latest version of my ‘killer contract’ for web designers and developers

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008

…………………………

@caniszczyk
caniszczyk / clone-all-twitter-github-repos.sh
Created October 9, 2012 04:25
Clone all repos from a GitHub organization
curl -s https://api.github.com/orgs/twitter/repos?per_page=200 | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}'
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"