Skip to content

Instantly share code, notes, and snippets.

View dancojocaru2000's full-sized avatar

Kenny dancojocaru2000

View GitHub Profile
final json = [
{
"name": "to",
"type": "address",
},
{
"name": "tokenId",
"type": "uint256",
},
];
final data = [
{
"name":"approve",
"inputs":[
{
"name":"to",
"type":"address"
},
{
"name":"tokenId",
@dancojocaru2000
dancojocaru2000 / main.dart
Created March 27, 2022 23:44
StatefulWidget with didUpdateWidget
import 'dart:async';
import 'package:flutter/material.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@dancojocaru2000
dancojocaru2000 / main.dart
Created March 27, 2022 23:37
StatefulWidget with initState
import 'dart:async';
import 'package:flutter/material.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@dancojocaru2000
dancojocaru2000 / main.dart
Created February 17, 2022 17:43
Interpolation example
void main() {
final a = Test();
print("Look, it's " + a.x.toString());
print("Look, it's $a.x");
print("Look, it's ${a.x}");
}
class Test {
final int x = 2;
}
@dancojocaru2000
dancojocaru2000 / dl.c
Created February 6, 2021 13:08
Dynamically Load printf
#include <dlfcn.h>
int main(void) {
// No error checking, use dlerror
void* current_proc = dlopen(0, 0);
int (*fp)() = dlsym(current_proc, "printf");
fp("Hello, World!\n");
return 0;
}
@dancojocaru2000
dancojocaru2000 / standard.c
Created February 6, 2021 12:59
Standard C
printf();
main(argc, argv)
int argc;
char * * argv;
{
int i;
for (i = 0; i < argc; i++)
{
printf("%s\n", argv[i]);
[ +78 ms] executing: [/Users/kbruen/flutter/] git rev-parse --abbrev-ref
--symbolic @{u}
[ +96 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[ ] origin/beta
[ ] executing: [/Users/kbruen/flutter/] git rev-parse --abbrev-ref HEAD
[ +24 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[ ] beta
[ +1 ms] executing: [/Users/kbruen/flutter/] git ls-remote --get-url origin
[ +28 ms] Exit code 0 from: git ls-remote --get-url origin
[ +2 ms] https://github.com/flutter/flutter.git
@dancojocaru2000
dancojocaru2000 / remove_comments.py
Last active May 2, 2018 05:37
Remove comments in compatible files (tested for JS, HTML)
#!/usr/bin/env python3
import os
import sys
if len(sys.argv) < 2:
print("Remove comments in compatible files")
print("// ... = remove from // until LF")
print("/* ... */ = remove from /* to first */ found after it")
print("<!-- ... --> = similar to /* ... */")
print()
@dancojocaru2000
dancojocaru2000 / codeblocks.cpp
Created March 16, 2017 20:54
Code::Blocks C++ Console Application Template
#include <iostream>
using namespace std;
int main()
{
cout << "Hello world! << endl;
return 0;
}