Skip to content

Instantly share code, notes, and snippets.

View d0mmie's full-sized avatar

Bulin Somsri d0mmie

  • thailand
View GitHub Profile
@d0mmie
d0mmie / 1_Storage.sol
Created February 1, 2021 19:32
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.7.4+commit.3f05b770.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.8.0;
/**
* @title Storage
* @dev Store & retrieve value in a variable
*/
contract Storage {
ms = int(input("Input number of millisecons: "))
remainHour = ms % (1000 * 60 * 60 * 24)
remainMinute = remainHour % (1000 * 60 * 60)
remainSecond = remainMinute % (1000 * 60)
remainMillesec = remainSecond % 1000
print("Result = %d day(s), %d hour(s), %d minute(s), %d second(s), and %d millisec(s)" % (ms /(1000 * 60 * 60 * 24), remainHour / (1000 * 60 * 60), remainMinute / (1000 * 60) , remainSecond / 1000, remainMillesec ))
print("First Equation")
m1 = int(input("Input m1: "))
b1 = int(input("Input b1: "))
print("Second Equation")
m2 = int(input("Input m2: "))
b2 = int(input("Input b2: "))
weight = float(input("Input weight in kg: "))
height = float(input("Input height in cm: "))
print("Weight = %.2f kg., Height = %.2f, BMI = %.2f" % (weight, height, (weight / pow(height / 100, 2))))
c_temp = float(input("Input temperature in Celcius: "))
print("%.2f Celcius = %.2f Farenheit" % (c_temp, ((c_temp * 9 / 5) + 32)))
f_temp = float(input("Input temperature in Fahrenheit: "))
print("%.2f Farenheit = %.2f Celcius" % (f_temp, (f_temp - 32) * 5 / 9))
export default async (obj) => {
const promiseArray = await Promise.all(Object.values(obj))
return Object.keys(obj).map((key, index) => ({ key, index })).reduce((total, { key, index }) => ({ ...total, [key]: promiseArray[index] }), {})
}
const Verifier = idText => {
return (11 - (idText.slice(0, 12).split('').map((val, key) => parseInt(val) * (13 - key)).reduce((current, total) => total + current) % 11)).toString().slice(-1) === idText[12]
}
package main
import (
"fmt"
)
func main() {
lengther := 0
couter := 0
data := [] string{}
[
{
"imgUrl":"https://instagram.fbkk1-1.fna.fbcdn.net/t51.2885-19/s1080x1080/23967678_2450308458528369_2368630126796603392_n.jpg",
"name":"Laksika",
"birthday":"1 August 2003",
"lastUsed": "1 August 2003",
"product": [
{
"text": "น้องอ้อน"
},