Skip to content

Instantly share code, notes, and snippets.

View 0x000-0's full-sized avatar
🎯
code make me cry😕

Awsl 0x000-0

🎯
code make me cry😕
View GitHub Profile
@bowmanb
bowmanb / RxJavaCollectExample.java
Last active February 22, 2020 14:07
RxJava collect() example. Converting a list of phrases into a list of their IDs only.
@Override
public void onNext(ArrayList<Phrase> phrases) {
ArrayList<Integer> phraseIDs = new ArrayList<>();
Observable
.from(phrases)
.collect(phraseIDs, new Action2<ArrayList<Integer>, Phrase>() {
@Override
public void call(ArrayList<Integer> integers, Phrase phrase) {
integers.add(phrase.getId());
}
@JaviLorbada
JaviLorbada / FRP iOS Learning resources.md
Last active April 20, 2025 21:15
The best FRP iOS resources.

Videos

@janogarcia
janogarcia / email_coding_guidelines.md
Last active November 26, 2024 15:35
Email Coding Guidelines
@RockerFlower
RockerFlower / GroupViewHolder
Created December 11, 2014 08:17
A RecyclerView with multiple view type.
public class GroupViewHolder extends MainViewHolder {
@InjectView ( R.id.groupTitle )
TextView mTitle;
@InjectView ( R.id.groupContent )
TextView mContent;
public GroupViewHolder ( View itemView ) {
super ( itemView );
@mscharhag
mscharhag / Java8DateTimeExamples.java
Created February 24, 2014 19:53
Examples for using the Java 8 Date and Time API (JSR 310)
import java.time.*;
import java.time.format.DateTimeFormatter;
import java.time.format.FormatStyle;
import java.time.temporal.ChronoUnit;
import java.time.temporal.TemporalAdjusters;
import java.util.*;
import static java.time.temporal.TemporalAdjusters.*;
public class Java8DateTimeExamples {
@gabrielemariotti
gabrielemariotti / build.gradle
Last active November 22, 2024 19:55
Use signing.properties file which controls which keystore to use to sign the APK with gradle.
android {
signingConfigs {
release
}
buildTypes {
release {
signingConfig signingConfigs.release
}
@ide-an
ide-an / yin-yang.js
Last active July 6, 2017 07:30
yin-yang puzzleをJavaScript(Rhino)に移植してみた。 参考 http://practical-scheme.net/wiliki/wiliki.cgi?Scheme%3Acall%2Fcc%E3%83%91%E3%82%BA%E3%83%AB
var callcc = function(f){
var c = new Continuation();
return f(c);
};
// Original code
// (let* ((yin ((lambda (cc) (newline) cc)
// (call/cc (lambda (bar) bar))))
// (yang ((lambda (cc) (display "*") cc)
// (call/cc (lambda (foo) foo)))))
@ChrisTM
ChrisTM / throttle.py
Created June 21, 2013 21:33
Python decorator for throttling function calls.
class throttle(object):
"""
Decorator that prevents a function from being called more than once every
time period.
To create a function that cannot be called more than once a minute:
@throttle(minutes=1)
def my_fun():
pass
@poppen
poppen / menu.lst
Created July 23, 2012 03:01
menu.lst of grub4dos for booting iso images from usb drive
# This is a sample menu.lst file. You should make some changes to it.
# The old install method of booting via the stage-files has been removed.
# Please install GRLDR boot strap code to MBR with the bootlace.com
# utility under DOS/Win9x or Linux.
color white/light-blue yellow/cyan light-gray/magenta white/light-red
title Acronis True Image Home
find --set-root /atih.iso
map /atih.iso (0xff) || map --mem /atih.iso (0xff)