Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
import java.util.Set; | |
import java.util.HashSet; | |
public class Deps { | |
public static void main(String[] args) { | |
System.out.println(Math.random()); | |
Set<String> set = new HashSet<>(); | |
} | |
} |
Press minus + shift + s
and return
to chop/fold long lines!
public class MyApp extends Application { | |
@Override | |
public void onCreate() { | |
TypefaceUtil.overrideFont(getApplicationContext(), "SERIF", "fonts/Roboto-Regular.ttf"); // font from assets: "assets/fonts/Roboto-Regular.ttf | |
} | |
} |
/* | |
* Copyright 2014 Chris Banes | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
public class CircularProgressDrawable extends Drawable | |
implements Animatable { | |
private static final Interpolator ANGLE_INTERPOLATOR = new LinearInterpolator(); | |
private static final Interpolator SWEEP_INTERPOLATOR = new DecelerateInterpolator(); | |
private static final int ANGLE_ANIMATOR_DURATION = 2000; | |
private static final int SWEEP_ANIMATOR_DURATION = 600; | |
private static final int MIN_SWEEP_ANGLE = 30; | |
private final RectF fBounds = new RectF(); |
Last updated: 2017-03-18
exiftool -filename -filemodifydate -createdate -r -if '(not $datetimeoriginal) and $filetype eq "JPEG"' .
###Output photos that don't have datetimeoriginal to a CSV### Note this can take a long time if you have a lot of jpgs
import java.time.LocalDateTime; | |
import java.time.ZoneId; | |
import java.time.ZonedDateTime; | |
import java.time.format.DateTimeFormatter; | |
import java.util.Locale; | |
public class DateTimeFormatterSample { | |
public static void main(String[] args) { | |
String[][] patterns = new String[][]{ | |
new String[]{"G", "appendText(ChronoField.ERA,"}, |
// Add to Cargo.toml | |
// [dependencies] | |
// winapi = "*" | |
// user32-sys = "*" | |
extern crate winapi; | |
extern crate user32; | |
fn from_wide_ptr(ptr: *const u16) -> String { | |
use std::ffi::OsString; | |
use std::os::windows::ffi::OsStringExt; |
[Android Transition Framework][transition-framework] can be used for three main things: