See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope> is optional
| // Copyright (C) 2018 LikeCoin Foundation Limited | |
| // | |
| // This file is part of LikeCoin Smart Contract. | |
| // | |
| // LikeCoin Smart Contract is free software: you can redistribute it and/or modify | |
| // it under the terms of the GNU General Public License as published by | |
| // the Free Software Foundation, either version 3 of the License, or | |
| // (at your option) any later version. | |
| // | |
| // LikeCoin Smart Contract is distributed in the hope that it will be useful, |
| contract PatriciaTree { | |
| // List of all keys, not necessarily sorted. | |
| bytes[] keys; | |
| // Mapping of hash of key to value | |
| mapping (bytes32 => bytes) values; | |
| struct Label { | |
| bytes32 data; | |
| uint length; | |
| } |
| // Bytecode origin https://www.reddit.com/r/ethereum/comments/6ic49q/any_assembly_programmers_willing_to_write_a/dj5ceuw/ | |
| // Modified version of Vitalik's https://www.reddit.com/r/ethereum/comments/6c1jui/delegatecall_forwarders_how_to_save_5098_on/ | |
| // Credits to Jordi Baylina for this way of deploying contracts https://gist.github.com/jbaylina/e8ac19b8e7478fd10cf0363ad1a5a4b3 | |
| // Forwarder is slightly modified to only return 256 bytes (8 normal returns) | |
| // Deployed Factory in Kovan: https://kovan.etherscan.io/address/0xaebc118657099e2110c90494f48b3d21329b23eb | |
| // Example of a Forwarder deploy using the Factory: https://kovan.etherscan.io/tx/0xe995dd023c8336685cb819313d933ae8938009f9c8c0e1af6c57b8be06986957 | |
| // Just 66349 gas per contract |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| int addi(int a, int b) { | |
| return a + b; | |
| } | |
| char *adds(char *a, char *b) { | |
| char *res = malloc(strlen(a) + strlen(b) + 1); |
| #!/usr/bin/python | |
| # | |
| # this script will push an OTA update to the ESP | |
| # | |
| # use it like: python ota_server.py <ESP_IP_address> <sketch.bin> | |
| # | |
| # on the ESP side you need code like this: https://gist.github.com/igrr/43d5c52328e955bb6b09 to handle the update | |
| # | |
| import socket |
| /** | |
| * Custom Scroll listener for RecyclerView. | |
| * Based on implementation https://gist.github.com/ssinss/e06f12ef66c51252563e | |
| */ | |
| public abstract class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener { | |
| public static String TAG = "EndlessScrollListener"; | |
| private int previousTotal = 0; // The total number of items in the dataset after the last load | |
| private boolean loading = true; // True if we are still waiting for the last set of data to load. | |
| private int visibleThreshold = 5; // The minimum amount of items to have below your current scroll position before loading more. |
| * { | |
| font-size: 12pt; | |
| font-family: monospace; | |
| font-weight: normal; | |
| font-style: normal; | |
| text-decoration: none; | |
| color: black; | |
| cursor: default; | |
| } |
| #include <PubSubClient.h> | |
| #include <ESP8266WiFi.h> | |
| const char* ssid = "................."; | |
| const char* password = "................"; | |
| char* topic = "esp8266_arduino_out"; | |
| char* server = "iot.eclipse.org"; | |
| import android.support.v7.widget.LinearLayoutManager; | |
| import android.support.v7.widget.RecyclerView; | |
| public abstract class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener { | |
| public static String TAG = EndlessRecyclerOnScrollListener.class.getSimpleName(); | |
| private int previousTotal = 0; // The total number of items in the dataset after the last load | |
| private boolean loading = true; // True if we are still waiting for the last set of data to load. | |
| private int visibleThreshold = 5; // The minimum amount of items to have below your current scroll position before loading more. | |
| int firstVisibleItem, visibleItemCount, totalItemCount; |