Skip to content

Instantly share code, notes, and snippets.

View Isabellle's full-sized avatar

Isabelle Lepez Isabellle

View GitHub Profile
@Isabellle
Isabellle / Get SSH Key - Public
Created June 30, 2017 07:47
Get SSH Key - Public
cat ~/.ssh/id_rsa.pub
@Isabellle
Isabellle / Git Common Commands
Last active June 26, 2017 15:25
Git Common Commands
Delete branch
git push origin --delete branchname
Force refresh of remote branch and list them
git fetch
git branch --all
Merge a branch onto another one
Merge branch 'branchname' into dev
import Foundation
extension String
{
var length: Int {
get {
return countElements(self)
}
}
In html:
<input type="file" name="files[]" data-picture="2" id="pic2" class="pic2" onClick="showAndroidToast('identity')">
<script type="text/javascript">
function showAndroidToast(type) {
androidPicture.showToast(type);
}
</script>
@Isabellle
Isabellle / Material Styles Android Button.xml
Last active November 21, 2016 15:57
Put Material Design styles on Buttons
style="@style/Widget.AppCompat.Button"
style="@style/Widget.AppCompat.Button.Colored"
style="@style/Widget.AppCompat.Button.Borderless"
style="@style/Widget.AppCompat.Button.Borderless.Colored"
@Isabellle
Isabellle / gist:46d652ba5449d5947a7a4aac4e31d1c6
Last active November 21, 2016 15:57
Layout Gravity tips
android:gravity sets the gravity of the content of the View its used on.
android:layout_gravity sets the gravity of the View or Layout in its parent.
@Isabellle
Isabellle / UIColorFromHex
Last active November 21, 2016 15:58
Swift - method to set hex to UIColor
func UIColorFromHex(rgbValue:UInt32, alpha:Double=1.0)->UIColor {
let red = CGFloat((rgbValue & 0xFF0000) >> 16)/256.0
let green = CGFloat((rgbValue & 0xFF00) >> 8)/256.0
let blue = CGFloat(rgbValue & 0xFF)/256.0
return UIColor(red:red, green:green, blue:blue, alpha:CGFloat(alpha))
}
@Isabellle
Isabellle / CustomItemClickListener.java
Created October 10, 2016 09:09 — forked from riyazMuhammad/CustomItemClickListener.java
Easy Implementation of RecyclerView custom onItemClickListener
public interface CustomItemClickListener {
public void onItemClick(View v, int position);
}
@Isabellle
Isabellle / gradle.properties
Created August 22, 2016 09:25
Increase Memory allocated to Gradle
org.gradle.jvmargs=-Xmx4096M -XX:MaxPermSize=2048m
@Isabellle
Isabellle / LocationManager.java
Created August 19, 2016 09:30
Manager to deal with GetLastKnownLocation and LocationListener
package ****
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;