Skip to content

Instantly share code, notes, and snippets.

View noloman's full-sized avatar
🏠
Working from home

Manuel Lorenzo noloman

🏠
Working from home
View GitHub Profile
@suryart
suryart / application.html.erb
Last active October 26, 2023 00:16
Rails 4 flash messages using Twitter Bootstrap(bootstrap-sass: https://github.com/thomas-mcdonald/bootstrap-sass). An improved version of https://gist.github.com/roberto/3344628
// layout file
<body>
<div class="container">
<%= flash_messages %>
<%= yield %>
</div><!-- /container -->
</body>
@staltz
staltz / introrx.md
Last active November 17, 2024 01:08
The introduction to Reactive Programming you've been missing
@Integralist
Integralist / testing a ruby gem.md
Last active June 29, 2023 15:58
Testing a Ruby Gem

Version 1

# Long way of doing things (new files need to be added to staging area *before* building the gem)
git add . && gem build my_gem.gemspec && gem install my_gem-0.0.0.gem

Version 2

@keyboardr
keyboardr / HeadlessFragment.java
Last active December 31, 2021 01:05
A file template for creating a headless Fragment. The attach() methods add the fragment to the parent if it doesn't already exist and returns the attached fragment. The methods ensure that the parent implements the parent interface. If needed, parameters may be added to the attach() methods to supply fragment arguments.
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentManager;
#parse("File Header.java")
public class ${NAME} extends Fragment {
private static final String FRAG_TAG = ${NAME}.class.getCanonicalName();
@Takhion
Takhion / build.gradle
Created May 30, 2015 15:44
Automatic Java home (7/8) for Retrolambda with Gradle
String getJavaHome(String version)
{
def stdout = new ByteArrayOutputStream()
exec {
commandLine "/usr/libexec/java_home", "-v", version
standardOutput = stdout;
}
return stdout.toString().trim()
}
@gabrielemariotti
gabrielemariotti / README.md
Last active February 24, 2021 10:52
How to manage the support libraries in a multi-module projects. Thanks to Fernando Cejas (http://fernandocejas.com/)

Centralize the support libraries dependencies in gradle

Working with multi-modules project, it is very useful to centralize the dependencies, especially the support libraries.

A very good way is to separate gradle build files, defining something like:

root
  --gradleScript
 ----dependencies.gradle
import android.util.Log;
import com.squareup.okhttp.Headers;
import com.squareup.okhttp.Interceptor;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.Response;
import com.squareup.okhttp.ResponseBody;
import org.threeten.bp.Clock;
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/blue_facebook_dark">
<item>
<shape android:shape="rectangle" >
<corners android:radius="10dp"/>
<solid android:color="@color/blue_facebook"/>
</shape>
</item>
</ripple>
@hrules6872
hrules6872 / AdvancedRadioGroup.java
Last active March 17, 2016 15:04
AdvancedRadioGroup
public class AdvancedRadioGroup extends LinearLayout {
private int radioButtonCheckedId;
private boolean working;
private RadioGroup.OnCheckedChangeListener listener;
public AdvancedRadioGroup(Context context) {
this(context, null);
}
@pandafulmanda
pandafulmanda / Python3 Virtualenv Setup.md
Last active October 5, 2024 17:12 — forked from akszydelko/Python3 Virtualenv Setup.md
Setting up and using Python3 Virtualenv on Mac

Python3 Virtualenv Setup

Requirements
  • Python 3
  • Pip 3
$ brew install python3