Skip to content

Instantly share code, notes, and snippets.

View es0329's full-sized avatar

Eric es0329

View GitHub Profile
@elsassph
elsassph / sublimelinter-settings.json
Created January 5, 2012 13:22
My SublimeLinter's settings
[...]
/*
The minimum delay in seconds (fractional seconds are okay) before
a linter is run when the "sublimelinter" setting is true. This allows
you to have background linting active, but defer the actual linting
until you are idle. When this value is greater than the built in linting delay,
errors are erased when the file is modified, since the assumption is
you don't want to see errors while you type.
*/
@mikezter
mikezter / gitlog.sh
Created January 13, 2012 14:32
Extract a a git-log for each month
#/bin/bash
year=2011
function header {
begin='Tätigkeiten '
case $1 in
1) month='Januar ';;
2) month='Februar ';;
3) month='März ';;
@mislav
mislav / aprompt.png
Last active May 17, 2025 18:20
My zsh prompt. No oh-my-zsh needed
aprompt.png
@mlconnor
mlconnor / country_date_formats.csv
Created February 22, 2012 20:49
Listing of countries with their preferred date formats, ISO3166 code, ISO629-2
ISO 3166 Country Code ISO639-2 Country Code Country ISO 3166 Country Code ISO639-2 Lang Language Date Format
ALB AL Albania sqi sq Albanian yyyy-MM-dd
ARE AE United Arab Emirates ara ar Arabic dd/MM/yyyy
ARG AR Argentina spa es Spanish dd/MM/yyyy
AUS AU Australia eng en English d/MM/yyyy
AUT AT Austria deu de German dd.MM.yyyy
BEL BE Belgium fra fr French d/MM/yyyy
BEL BE Belgium nld nl Dutch d/MM/yyyy
BGR BG Bulgaria bul bg Bulgarian yyyy-M-d
BHR BH Bahrain ara ar Arabic dd/MM/yyyy
@jewelsea
jewelsea / Sample Dynamic Line Chart
Last active November 8, 2024 21:56
DynamicLineChart.java
import javafx.application.Application;
import javafx.collections.*;
import javafx.geometry.Pos;
import javafx.scene.*;
import javafx.scene.chart.*;
import javafx.scene.chart.XYChart;
import javafx.scene.control.*;
import javafx.scene.layout.*;
import javafx.scene.shape.Line;
import javafx.stage.Stage;
@JakeWharton
JakeWharton / AspectRatioImageView.java
Created June 2, 2012 02:14
ImageView that respects an aspect ratio applied to a specific measurement.
// Copyright 2012 Square, Inc.
package com.squareup.widgets;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.widget.ImageView;
/** Maintains an aspect ratio based on either width or height. Disabled by default. */
public class AspectRatioImageView extends ImageView {
@sidharthkuruvila
sidharthkuruvila / gist:3154845
Created July 21, 2012 06:30
Utility to functions to convert between camel case and underscore separated names
/**
* Takes a camel cased identifier name and returns an underscore separated
* name
*
* Example:
* camelToUnderscores("thisIsA1Test") == "this_is_a_1_test"
*/
def camelToUnderscores(name: String) = "[A-Z\\d]".r.replaceAllIn(name, {m =>
"_" + m.group(0).toLowerCase()
})
@Irio
Irio / PropositionListActivity.java
Created July 24, 2012 01:08
Android - How to move ActionBar.Tab's icon as your needs (example using ActionBarSherlock)
import com.actionbarsherlock.app.ActionBar;
import com.actionbarsherlock.app.ActionBar.Tab;
import com.actionbarsherlock.app.SherlockActivity;
import android.os.Bundle;
import android.app.Activity;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.util.Log;
import android.view.Menu;
@gorankrstevski
gorankrstevski / AuthWithGoogle
Created August 15, 2012 13:04
Authenticate with Google account on Android. Get Access Token valid for User Info Rest service : https://www.googleapis.com/oauth2/v1/userinfo
private String updateToken(boolean invalidateToken) {
String authToken = "null";
try {
AccountManager am = AccountManager.get(getApplicationContext());
Account[] accounts = am.getAccountsByType("com.google");
AccountManagerFuture<Bundle> accountManagerFuture;
if (this == null) {//this is used when calling from an interval thread
accountManagerFuture = am.getAuthToken(accounts[0], "oauth2:https://www.googleapis.com/auth/userinfo.profile" , false, null, null);
} else {
accountManagerFuture = am.getAuthToken(accounts[0], "oauth2:https://www.googleapis.com/auth/userinfo.profile" , null, this, null, null);
@ksoichiro
ksoichiro / LinkUtils.java
Created August 19, 2012 11:22
Android: Clickable URL and clickable TextView
package com.blogspot.ksoichiro.linktest;
import android.text.Layout;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.TextUtils;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;