Skip to content

Instantly share code, notes, and snippets.

View leodufer's full-sized avatar
🌴
On vacation

Oscar Duarte leodufer

🌴
On vacation
View GitHub Profile
@leodufer
leodufer / .gitignore
Created June 1, 2017 18:24 — forked from smebberson/.gitignore
Express simple authentication example
node_modules
*.swp
@leodufer
leodufer / Readme.md
Created April 17, 2016 18:40 — forked from gabrielemariotti/Readme.md
A SimpleSectionedRecyclerViewAdapter: use this class to realize a simple sectioned `RecyclerView.Adapter`.

You can use this class to realize a simple sectioned RecyclerView.Adapter without changing your code.

The RecyclerView should use a LinearLayoutManager. You can use this code also with the TwoWayView with the ListLayoutManager (https://github.com/lucasr/twoway-view)

This is a porting of the class SimpleSectionedListAdapter provided by Google

Screen

Example:

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
# Copyright: Benjamin Weiss (keyboardsurfer) https://github.com/keyboardsurfer
# Under CC-BY-SA V3.0 (https://creativecommons.org/licenses/by-sa/3.0/legalcode)
# built application files
*.apk
*.ap_
*.jar
# lint folder
lint
import com.google.gson.Gson;
import com.google.gson.JsonSyntaxException;
import com.android.volley.AuthFailureError;
import com.android.volley.NetworkResponse;
import com.android.volley.ParseError;
import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.Response.ErrorListener;
import com.android.volley.Response.Listener;
fromNow = (d) ->
unless d instanceof Date
d = new Date(d)
difference = d - new Date()
# string, limit, divider
limits = [
["momentos", 1000, 1]
["%d segundos", 1000*60, 1000]

Para onde caminha a comunidade brasileira de front end?

Hoje algo cômico e surreal aconteceu na comunidade FrontEnd Brasil. Algo chocante a ponto de desanimar o mais engajado dos participantes.

Após postar um Gist sobre moment com um código bastante didático, Berger foi rechaçado pelo moderador da comunidade, Jean Carlo Nascimento. Ao notar que o gist era escrito em CoffeeScript, o moderador comentou uma piadinha:

Prefiro usar moment a coffee.

A comunidade não gostou e reagiu, criticando o comentário infeliz e prezando o autor por compartilhar um código útil. Não satisfeito, as agressões sobre o uso de CoffeeScript continuaram.

public String uploadServer() {
try {
File file = new File("String url da foto");
HttpClient httpClient = new DefaultHttpClient();
HttpPost postRequest = new HttpPost("url para enviar o post");
ContentType contentType = ContentType.create("image/png");
String boundary = String.valueOf(System.currentTimeMillis());
MultipartEntityBuilder entity = MultipartEntityBuilder.create();
entity.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
public class UploadConnection extends Thread {
private String serverResponseMessage;
private int serverResponseCode;
private String urlServer;
private String pathToOurFile;