Skip to content

Instantly share code, notes, and snippets.

View ali2236's full-sized avatar
💭
Stuff'n Things!

Ali Qanbari ali2236

💭
Stuff'n Things!
View GitHub Profile
@ali2236
ali2236 / table-calendar-json.dart
Created November 8, 2020 07:13
convert a json to table calendar events
import 'dart:convert';
void main() {
var jsonSource = """
{
"Events": [
{
"id": 1,
"event_name": "Cake tasting",
"event_photo": "https://dispensaries.s3.amazonaws.com/event_photo/Southern_Cali_Kush_3.jpg",
@ali2236
ali2236 / dart_ffi.dart
Created October 13, 2020 10:04
fibonacci dart ffi
import 'dart:ffi';
// long fibonacci(int n)
typedef NativeFibonacci = Int64 Function(Int64 n);
typedef DartFibonacci = int Function(int n);
class Fibonacci {
static final dll = DynamicLibrary.open('fibonacci.dll');
@ali2236
ali2236 / fibonacci.c
Created October 13, 2020 09:55
fibonacci in c
long long fibonacci(long long n) {
if (n <= 1) return 1;
return fibonacci(n - 1) + fibonacci(n - 2);
}