Skip to content

Instantly share code, notes, and snippets.

View sumio's full-sized avatar

TOYAMA Sumio sumio

View GitHub Profile
@clintel
clintel / gist:1155906
Created August 19, 2011 02:40
Fenced code in bullet lists with GitHub-flavoured MarkDown??

Fenced code blocks inside ordered and unordered lists

  1. This is a numbered list.

  2. I'm going to include a fenced code block as part of this bullet:

    Code
    More Code
    
@casidiablo
casidiablo / SimpleCursorLoader.java
Created September 14, 2011 20:03
Used to write apps that run on platforms prior to Android 3.0. When running on Android 3.0 or above, this implementation is still used; it does not try to switch to the framework's implementation. See the framework SDK documentation for a class overview
/*
* Copyright 2012 CodeSlap - Cristian Castiblanco
*
* 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
@grantland
grantland / gist:3949145
Created October 24, 2012 21:50
Fix for "Dx warning: Ignoring InnerClasses attribute for an anonymous inner class"
To fix the following warning, you must add "-keepattributes EnclosingMethod" to your proguard config.
Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(me.kiip.internal.c.h) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
@kmakita13714
kmakita13714 / init.el
Created April 17, 2013 16:23
私が、Emacs24で利用しているフォントの設定です。 日本語フォントは「Takaoゴシック」を、ASCIIフォントは「Source Code Pro」を利用しています! Source Code Proは、見やすくていいと思います!!
(when (>= emacs-major-version 24)
;; フォントセットを作る
(let* ((fontset-name "myfonts") ; フォントセットの名前
(size 14) ; ASCIIフォントのサイズ [9/10/12/14/15/17/19/20/...]
(asciifont "Source Code Pro") ; ASCIIフォント
(jpfont "Takaoゴシック") ; 日本語フォント
(font (format "%s-%d:weight=normal:slant=normal" asciifont size))
(fontspec (font-spec :family asciifont))
(jp-fontspec (font-spec :family jpfont))
(fsn (create-fontset-from-ascii-font font nil fontset-name)))
@STAR-ZERO
STAR-ZERO / PostprocessBuildPlayer.rb
Last active February 21, 2020 05:44
UnityのiOSビルド時にローカライズファイルを設定する
#!/usr/bin/env ruby
require 'xcodeproj'
require 'fileutils'
PROJECT = 'Unity-iPhone'
TARGET = 'Unity-iPhone'
LIBRARY = 'Libraries'
LOCALIZE = 'Localize'
@P7h
P7h / jdk_download.sh
Last active May 21, 2024 02:10
Script to download JDK / JRE / Java binaries from Oracle website from terminal / shell / command line / command prompt
##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### #####
### Shell script to download Oracle JDK / JRE / Java binaries from Oracle website using terminal / command / shell prompt using wget.
### You can download all the binaries one-shot by just giving the BASE_URL.
### Script might be useful if you need Oracle JDK on Amazon EC2 env.
### Script is updated for every JDK release.
### Features:-
# 1. Resumes a broken / interrupted [previous] download, if any.
# 2. Renames the file to a proper name with including platform info.
@Grab(group='org.imgscalr', module='imgscalr-lib', version='4.2') // Grailsの場合はBuildConfig.groovyのdependenciesに 「compile 'org.imgscalr:imgscalr-lib:4.2'」
import java.awt.image.BufferedImage
import javax.imageio.ImageIO
import org.imgscalr.*
def srcFilepath = "/path/to/target.jpg"
def destFormat = 'jpg'
BufferedImage sourceImg = ImageIO.read(new File(srcFilepath))
@avbk
avbk / robo.md
Last active October 14, 2017 00:16
Testing with Robolectric within Android Studio

Testing with Robolectric within Android Studio

Prerequisites

0. Setup a project

Setup a new Android project with Android Studio. If you already have done this you can skip this step.

// please check https://github.com/bademux/robolectric-java-gradle-plugin instead
//build.gradle
//fixes AndroidStudion<>Robolectric integration
//fixes 'java.lang.RuntimeException: Stub!' and 'NoClassDefFoundError'
gradle.projectsEvaluated {
def imlFile = file(project.name + '.iml')
def parsedXml;
/*
MIT License
Copyright (c) 2015 Adel Nizamutdinov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is