Skip to content

Instantly share code, notes, and snippets.

View akifumi's full-sized avatar
📱
Developing mobile apps

Akifumi Fukaya akifumi

📱
Developing mobile apps
View GitHub Profile
contract Auction {
address currentLeader;
uint highestBid;
mapping (address => uint) usersBalance;
function bid () payable {
require (msg.value > highestBid);
// 現在の最高価格入札者の返金額を更新する
usersBalance[currentLeader] += highestBid;
currentLeader = msg.sender;
contract Auction {
address currentLeader;
uint highestBid;
function bid () payable {
require (msg.value > highestBid);
require (currentLeader.send(highestBid));
currentLeader = msg.sender;
var DappsToken = artifacts.require("./DappsToken.sol");
module.exports = function(deployer) {
var initialSupply = 1000e18;
deployer.deploy(DappsToken, initialSupply, {
gas: 2000000
});
};
var HDWalletProvider = require("truffle-hdwallet-provider");
var mnemonic = $MNEMONIC;
var accessToken = $INFURA_ACCESS_TOKEN;
module.exports = {
networks: {
development: {
host: "localhost",
port: 8545,
network_id: "10"
module.exports = {
networks: {
development: {
host: "localhost",
port: 8545,
network_id: "10"
},
}
};
@akifumi
akifumi / kotlin_app_build.gradle
Last active June 22, 2016 15:09
app/build.gradle for kotlin
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
android {
compileSdkVersion 24
buildToolsVersion "24.0.0"
defaultConfig {
applicationId "net.akifumifukaya.kotlintrial"
minSdkVersion 19
package net.akifumifukaya.togglebuttonsample;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ImageButton;
import android.widget.ToggleButton;
public class MainActivity extends AppCompatActivity {
<ToggleButton
android:id="@+id/toggleButton"
android:layout_width="24dp"
android:layout_height="24dp"
android:background="@drawable/ic_check_box_selector"
android:textOff=""
android:textOn="" />
<ImageButton
android:id="@+id/imageButton"
android:layout_width="24dp"
android:layout_height="24dp"
android:background="@android:color/transparent"
android:src="@drawable/ic_check_box_selector" />
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_check_box_outline_blank_black_24dp" android:state_selected="false" />
<item android:drawable="@drawable/ic_check_box_black_24dp" android:state_selected="true" />
</selector>