Skip to content

Instantly share code, notes, and snippets.

View carloschneider's full-sized avatar
:octocat:
.

Carlo Schneider carloschneider

:octocat:
.
View GitHub Profile
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"caret_style": "phase",
"draw_minimap_border": true,
"ensure_newline_at_eof_on_save": true,
"folder_exclude_patterns":
[
".svn",
".git",
@carloschneider
carloschneider / collections.liquid.html
Last active April 5, 2016 21:38 — forked from rickydazla/collections.liquid.html
"Infinite" scrolling in Shopify collections
{% paginate collection.products by 20 %}
<ul class="collection-matrix">
{% for product in collection.products %}
<li id="product-{{ forloop.index | plus:paginate.current_offset }}">
{% include 'product' with product %}
</li>
{% endfor %}
<li class="top"><a href="#collectionpage">Back to Top</a> &uarr;</li>
{% if paginate.next %}
<li class="more">&darr; <a href="{{ paginate.next.url }}">More</a></li>
@carloschneider
carloschneider / forward.md
Created April 30, 2017 23:46 — forked from jamestalmage/forward.md
Using Firebase to Authenticate to Google Drive

Note: There is a lot of information here, but if I have provided a link, it is probably something you should click on and read. OAuth is a complex enough subject on it's own, and hacking these two services together only adds to it.

Even so, I have found Firebase's API to be simpler than almost any other OAuth solution I have explored. When all is said and done, the important bits of code related to authentication is actually less than 10 lines. If you have ever tried to implement your own OAuth flow before, you know how amazing that is.

In the end, it may be worth using Firebase for authentication, even if that's the ONLY thing you use it for.

@carloschneider
carloschneider / string-to-slug.js
Created October 17, 2017 19:55 — forked from spyesx/string-to-slug.js
String to slug in JS (wordpress sanitize_title)
var string_to_slug = function (str)
{
str = str.replace(/^\s+|\s+$/g, ''); // trim
str = str.toLowerCase();
// remove accents, swap ñ for n, etc
var from = "àáäâèéëêìíïîòóöôùúüûñç·/_,:;";
var to = "aaaaeeeeiiiioooouuuunc------";
for (var i=0, l=from.length ; i<l ; i++)
@carloschneider
carloschneider / iterm2-solarized.md
Created January 23, 2018 15:21 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@carloschneider
carloschneider / fauxSelect.js
Created April 6, 2018 16:15 — forked from philfreo/fauxSelect.js
Give a <select> element a different look, but still retain all OS benefits of using a real <select> (full screen height options list, keyboard navigation, etc.)
// Make faux dropdowns show their new value, when it's changed.
$(document.body).on('change', '.faux-select-wrapper select', function(e) {
var select = $(e.target);
$.fn.fauxSelect.refresh(select);
});
$.fn.fauxSelect = function(method) {
var select = this;
// if fauxSelect is being called again on an already-handled element, then just update the
// visible text
@carloschneider
carloschneider / select-estados-br
Created October 25, 2018 13:49 — forked from cassiocardoso/select-estados-br
Select com uma lista de todos os estados brasileiros.
<select name="estados-brasil">
<option value="AC">Acre</option>
<option value="AL">Alagoas</option>
<option value="AP">Amapá</option>
<option value="AM">Amazonas</option>
<option value="BA">Bahia</option>
<option value="CE">Ceará</option>
<option value="DF">Distrito Federal</option>
<option value="ES">Espírito Santo</option>
<option value="GO">Goiás</option>
@carloschneider
carloschneider / .zshrc
Last active October 24, 2019 20:05
ZSH
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/home/carlo/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
server {
server_name testdeploy.rocketseat.com.br;
location / {
proxy_pass http://127.0.0.1:3333;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;