Skip to content

Instantly share code, notes, and snippets.

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

Awsl tyzero

🎯
code make me cry😕
View GitHub Profile
@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)
@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
@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)))))
@gabrielemariotti
gabrielemariotti / build.gradle
Last active January 12, 2024 17:41
Use signing.properties file which controls which keystore to use to sign the APK with gradle.
android {
signingConfigs {
release
}
buildTypes {
release {
signingConfig signingConfigs.release
}
@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 {
@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 );
@janogarcia
janogarcia / email_coding_guidelines.md
Last active March 13, 2024 12:13
Email Coding Guidelines
@JaviLorbada
JaviLorbada / FRP iOS Learning resources.md
Last active April 8, 2024 18:07
The best FRP iOS resources.

Videos

@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());
}
@pyricau
pyricau / OomExceptionHandler.java
Created May 6, 2015 17:18
Dump the heap on OutOfMemoryError crashes in your debug builds.
import android.content.Context;
import android.os.Debug;
import java.io.File;
public class OomExceptionHandler implements Thread.UncaughtExceptionHandler {
private static final String FILENAME = "out-of-memory.hprof";
public static void install(Context context) {
Thread.UncaughtExceptionHandler defaultHandler = Thread.getDefaultUncaughtExceptionHandler();