Skip to content

Instantly share code, notes, and snippets.

View thiagolocatelli's full-sized avatar

Thiago Locatelli thiagolocatelli

  • Charlotte, NC
View GitHub Profile
@flores
flores / gist:1623381
Created January 16, 2012 22:28
sample haproxy.cfg
global
log 127.0.0.1 local0 notice
maxconn 50000
daemon
stats socket /tmp/proxystats level admin
defaults
log global
mode http
option httplog
option dontlognull
@m14t
m14t / fix_github_https_repo.sh
Created July 5, 2012 21:57
Convert HTTPS github clones to use SSH
#/bin/bash
#-- Script to automate https://help.github.com/articles/why-is-git-always-asking-for-my-password
REPO_URL=`git remote -v | grep -m1 '^origin' | sed -Ene's#.*(https://[^[:space:]]*).*#\1#p'`
if [ -z "$REPO_URL" ]; then
echo "-- ERROR: Could not identify Repo url."
echo " It is possible this repo is already using SSH instead of HTTPS."
exit
fi
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@mreiferson
mreiferson / Dockerfile
Last active April 12, 2016 10:10
nsqd Dockerfile
FROM ubuntu
RUN apt-get -y install wget tar ca-certificates
RUN wget https://s3.amazonaws.com/bitly-downloads/nsq/nsq-0.2.23.linux-amd64.go1.1.2.tar.gz
RUN tar zxvf nsq-0.2.23.linux-amd64.go1.1.2.tar.gz
RUN mkdir -p /usr/local/bin
RUN cp /nsq-0.2.23.linux-amd64.go1.1.2/bin/nsqd /usr/local/bin
RUN mkdir -p /data
VOLUME ["/data"]
@staltz
staltz / introrx.md
Last active July 22, 2024 09:31
The introduction to Reactive Programming you've been missing
@w9jds
w9jds / CardPresenter.java
Last active February 1, 2024 10:23
Expanding Info Panel on ImageCardView for Android TV
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent) {
final ImageCardView cardView = new ImageCardView(mContext);
cardView.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View view, final boolean isFocused) {
final View infoField = view.findViewById(R.id.info_field);
final TextView contentField = (TextView)view.findViewById(R.id.content_text);
final TextView titleField = (TextView)view.findViewById(R.id.title_text);
@chrisbanes
chrisbanes / SystemUiHelper.java
Last active March 2, 2024 18:57
SystemUiHelper
/*
* Copyright (C) 2014 The Android Open Source Project
*
* 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
@addyosmani
addyosmani / README.md
Last active July 24, 2024 10:54 — forked from 140bytes/LICENSE.txt
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@skyfishjy
skyfishjy / CursorRecyclerViewAdapter.java
Last active December 16, 2023 08:55
CursorRecyclerViewAdapter
/*
* Copyright (C) 2014 skyfish.jy@gmail.com
*
* 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
@JakeWharton
JakeWharton / README.md
Last active April 17, 2023 14:07
A JUnit @rule which launches an activity when your test starts. Stop extending gross ActivityInstrumentationBarfCase2!