Skip to content

Instantly share code, notes, and snippets.

View Shujito's full-sized avatar
🗿
yes the whole earth

Alberto Ramos Shujito

🗿
yes the whole earth
View GitHub Profile
@BrandonSmith
BrandonSmith / AndroidManifest.xml
Last active July 19, 2023 19:11
Quick example of how to schedule a notification in the future using AlarmManager
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.cards.notification">
<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
@gerardorochin
gerardorochin / rfc regex
Created June 6, 2013 00:00
Expresion regular para validar RFC
/^([A-Z,Ñ,&]{3,4}([0-9]{2})(0[1-9]|1[0-2])(0[1-9]|1[0-9]|2[0-9]|3[0-1])[A-Z|\d]{3})$/
@codezjx
codezjx / CircleImageTransformation.java
Last active July 28, 2023 12:15
A picasso circle image transformation. Optimized version of: https://gist.github.com/julianshen/5829333. Use shader.setLocalMatrix() method to draw circle bitmap not from source bitmap left-top. So, we no need to create square bitmap!
/**
* Created by codezjx on 2016/5/4.
*/
public class CircleImageTransformation implements Transformation {
/**
* A unique key for the transformation, used for caching purposes.
*/
private static final String KEY = "circleImageTransformation";
@rfreedman
rfreedman / DebouncedOnClickListener.java
Created May 14, 2013 03:09
A debounced onClickListener for Android
import android.os.SystemClock;
import android.view.View;
import java.util.Map;
import java.util.WeakHashMap;
/**
* A Debounced OnClickListener
* Rejects clicks that are too close together in time.
* This class is safe to use as an OnClickListener for multiple views, and will debounce each one separately.
@tieorange
tieorange / ThrottledOnClickListener.kt
Last active September 18, 2023 07:03
A debounced onClickListener for Android
package com.westwingnow.android.utils
import android.os.SystemClock
import android.view.View
import java.util.*
/**
* A Throttled OnClickListener
* Rejects clicks that are too close together in time.
* This class is safe to use as an OnClickListener for multiple views, and will throttle each one separately.
@julianshen
julianshen / CircleTransform.java
Last active November 6, 2023 12:47
CircleTransform for Picasso
/*
* Copyright 2014 Julian Shen
*
* 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
@Keenuts
Keenuts / readme.md
Last active November 14, 2023 13:34
GSoC 2017 | Virgl Windows Driver

GSOC 2017 | Virgl Windows Driver

Project links

The project is split into several parts:

  • The kernel driver, with simple 3D command forwarding and 3D resource allocation
  • The userland driver, in fact the OpenGL backend
  • The reference, explaining virtio-gpu commands

https://github.com/Keenuts/virtio-gpu-win-icd \

@sleepyfox
sleepyfox / 2019-07-25-users-hate-change.md
Last active December 10, 2023 18:20
'Users hate change'

'Users hate change'

This week NN Group released a video by Jakob Nielsen in which he attempts to help designers deal with the problem of customers being resistant to their new site/product redesign. The argument goes thusly:

  1. Humans naturally resist change
  2. Your change is for the better
  3. Customers should just get used to it and stop complaining

There's slightly more to it than that, he caveats his argument with requiring you to have of course followed their best practices on product design, and allows for a period of customers being able to elect to continue to use the old site, although he says this is obviously only a temporary solution as you don't want to support both.

@gabrielbauman
gabrielbauman / CardType.java
Last active December 13, 2023 04:21
A Java enum representing credit card types (Visa, Mastercard etc) that can detect card type from a credit card number.
package com.gabrielbauman.gist;
import java.util.regex.Pattern;
public enum CardType {
UNKNOWN,
VISA("^4[0-9]{12}(?:[0-9]{3}){0,2}$"),
MASTERCARD("^(?:5[1-5]|2(?!2([01]|20)|7(2[1-9]|3))[2-7])\\d{14}$"),
AMERICAN_EXPRESS("^3[47][0-9]{13}$"),
@ymnk
ymnk / ECCKeyAgreement.java
Last active December 19, 2023 18:35
ECC with Java
// The following code is from http://www.academicpub.org/PaperInfo.aspx?PaperID=14496 .
import java.math.BigInteger;
import java.security.*;
import java.security.spec.*;
import javax.crypto.KeyAgreement;
public class ECCKeyAgreement {
public static void main(String[] args) throws Exception {
KeyPairGenerator kpg;
kpg = KeyPairGenerator.getInstance("EC","SunEC");