Skip to content

Instantly share code, notes, and snippets.

Juan Felipe Alvarez Saldarriaga nebiros

Block or report user

Report or block nebiros

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@delebedev
delebedev / opena.sh
Created Mar 19, 2014
Opens Xcode workspace or project with AppCode.
View opena.sh
opena(){
if test -n "$(find . -maxdepth 1 -name '*.xcworkspace' -print -quit)"
then
echo "Opening workspace"
open *.xcworkspace -a /Applications/AppCode.app
return
else
if test -n "$(find . -maxdepth 1 -name '*.xcodeproj' -print -quit)"
then
echo "Opening project"
View lib_charset.go
package lib
import (
"bytes"
"io"
"strings"
"errors"
"syscall"
"unicode/utf8"
)
View App_Thumb.php
<?php
class App_Thumb
{
protected $_width = null;
protected $_oldWidth = null;
protected $_height = null;
protected $_oldHeight = null;
protected $_imagePath = null;
protected $_resource = null;
@moltak
moltak / retrofit builder and request
Created Sep 19, 2014
retrofit builder and request
View retrofit builder and request
/**
* Retrofit adapter builder
* Created by moltak on 2014. 7. 9..
*/
public class LMNetworkBuilder {
public static RestAdapter getAdapter() {
return getBuilder().build();
}
public static RestAdapter.Builder getBuilder() {
@patrickhammond
patrickhammond / MockWebServerIssueTest.java
Last active Sep 14, 2015
Weird OkHttp API behavior where a thrown IOException (SocketTimeoutException) from onResponse does not propagate to onFailure. Discussion here: https://github.com/square/okhttp/issues/1066
View MockWebServerIssueTest.java
package com.demo.okhttpissue;
import android.test.InstrumentationTestCase;
import com.squareup.okhttp.Callback;
import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.Response;
import com.squareup.okhttp.mockwebserver.MockResponse;
import com.squareup.okhttp.mockwebserver.MockWebServer;
View Notification.java
// Real usage
WhiTemplater.Formatter FEATURED_FORMAT = new WhiTemplater.Formatter() {
@Override
public String format(Object value) {
return "<b>" + String.valueOf(value)+ "</b>";
}
};
WhiTemplater.Formatter NORMAL_FORMAT = new WhiTemplater.Formatter() {
View Cache.php
<?php
/**
* Based on FileCache class by Erik Giberti,
* http://af-design.com/blog/2010/07/30/simple-file-based-caching-in-php/
*
* @author nebiros
*/
class App_Cache {
/**
@nebiros
nebiros / Mysql.php
Created Oct 3, 2010
Mysql ala OOP, wrapper for some mysql_* functions
View Mysql.php
<?php
/**
* Mysql wrapper, to handle some mysql_* functions in a OOP way.
*
*/
class App_Db_Mysql {
const DEFAULT_ROW_COUNT = 10;
const DEFAULT_PAGE = 1;
@brianleroux
brianleroux / lawnchair-examples.js
Created Jan 27, 2011
examples for using lawnchair js
View lawnchair-examples.js
// create a new store
var store = new Lawnchair({adaptor:'dom', table:'people'});
// saving documents
store.save({name:'brian'});
// optionally pass a key
store.save({key:'config', settings:{color:'blue'}});
// updating a document in place is the same syntax
View Fibonacci.java
public class Fibonacci {
public static int fib(int n) {
if(n == 0 || n == 1) {
return n;
} else {
return fib(n-1) + fib(n-2);
}
}
You can’t perform that action at this time.