Skip to content

Instantly share code, notes, and snippets.

@davidkathoh
davidkathoh / contracts...c3solana.sol
Created June 7, 2024 16:57
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.8.26+commit.8a97fa7a.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.2 <0.9.0;
/**
* @title Storage
* @dev Store & retrieve value in a variable
* @custom:dev-run-script ./scripts/deploy_with_ethers.ts
*/
contract C3Solana {
@davidkathoh
davidkathoh / switch.js
Last active August 15, 2022 12:47
Swicthing and adding network programatically on metamask
async function switchN(){
const provider = window.ethereum;
const binanceTestChainId = '0x61';
if(!provider){
console.log("Metamask is not installed, please install!");
}else{
pragma solidity ^0.8.0;
contract SlitherDemo{
address public king;
uint public balance;
function claimThrone() external payable {
require(msg.value > balance, "Need to pay more to become the king");
(bool sent, ) = king.call{value: balance}("");
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Hover.initialize(this);// Initialisation de Hover
final EditText numero = findViewById(R.id.edNumber);
!#/bin/bash
start=$SECONDS #for duration
echo " installing apk ...."
log=log.txt
printf "" > $log
result=$(adb -d install -r livinggoods.apk) #installing apk on one device
imei=$(adb shell service call iphonesubinfo 1 | awk -F "'" '{print $2}' | sed '1 d'| tr -d '\n' | tr -d '.' | tr -d ' ') #IMEI
battery=$(adb shell dumpsys battery | grep level) #battery level
val stringNumber = "100"
val intValue = stringNumber.toInt()
val ticketPaye = true
val matchGagne = false
val jhonSalaire = 5000
val samSalaire = 4000
val gagnePlus = jhonSalaire > samSalaire// true
val monString = " je suis une chaine de charactere"
val escapeString = "ceci est une chaine de charactere avec une nouvelle ligne \n"
@davidkathoh
davidkathoh / lignes.kt
Created July 13, 2019 09:35
Multiple string lignes
val multipleStringLignes = """
la premeire ligne
la seconde ligne
la troisieme ligne"""
val balance = 200
val creditAlertMessage = " le solde de votre compte est de $balance" //le solde de votre compte est de 200