Skip to content

Instantly share code, notes, and snippets.

View sachaarbonel's full-sized avatar
👨‍💻
Uncovering bugs

Sacha Arbonel sachaarbonel

👨‍💻
Uncovering bugs
View GitHub Profile
@sachaarbonel
sachaarbonel / main.dart
Created June 5, 2019 07:10 — forked from jpotterm/main.dart
Flutter SVG Path Converter
// Generates canvas drawing commands from an SVG path string
import 'package:path_parsing/path_parsing.dart';
void main(List<String> args) {
if (args.length < 3) {
print('Usage: width height path_string');
return;
}
@sachaarbonel
sachaarbonel / index.html
Created June 4, 2019 22:23 — forked from graphicbeacon/index.html
WebAssembly in Dart for web example
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="scaffolded-by" content="https://github.com/google/stagehand" />
<title>webassembly_example</title>
<link rel="stylesheet" href="styles.css" />
#include <GraphDefDecryptor.hpp>
........
tensorflow::GraphDef graph;
// Decryption:
const std::string key = "JHEW8F7FE6F8E76W8F687WE6F8W8EF5";
auto status = tfsecured::GraphDefDecryptAES(path, // path to *.pb file (encrypted graph)
&graph,
@sachaarbonel
sachaarbonel / context.go
Created April 14, 2019 20:10 — forked from montanaflynn/context.go
An example of using context to cancel goroutines between server handlers
package main
import (
"context"
"fmt"
"log"
"net/http"
"sync"
"time"
)
@sachaarbonel
sachaarbonel / animation_card.dart
Created April 9, 2019 21:10 — forked from gbuela/animation_card.dart
Card flip animation in Flutter
import 'dart:math';
import 'package:flutter/material.dart';
// based on https://github.com/fedeoo/flip_card/
// provides a callback to the front & back widgets so they can trigger the flip, therefore the CardSideBuilder
// note this version only flips horizontally
class AnimationCard extends StatelessWidget {
AnimationCard({this.child, this.animation});
@sachaarbonel
sachaarbonel / center.dart
Created March 23, 2019 14:28 — forked from ggirou/center.dart
Center mass of SVG path elements
import 'dart:convert';
import 'dart:html';
import 'dart:math';
import 'dart:svg' as svg;
main() {
HttpRequest.getString('svg-datas.json').then(JSON.decode).then(calculateGravity);
}
calculateGravity(Map<String, Map> paths) {
@sachaarbonel
sachaarbonel / README.md
Created March 20, 2019 12:11 — forked from sma/README.md
This is an ad-hoc Java-to-Dart translator written in three days. This is version 2 which some bug fixes.

Java to Dart

This is an ad-hoc Java-to-Dart translator originally written on two (admittedly long) evenings.

See http://sma.github.io/stuff/java2dartweb/java2dartweb.html for a demo.

Note: It doesn't support the complete Java grammar specification and cannot translate everything. It only translates syntax and does not attempt to translate Java library classes and methods to Dart equivalents (with the exception of String.charAt and StringBuffer.append). You will have to make changes to the resulting Dart code. It does not support anonymous inner classes.

However, I was able to successfully convert a 7000+ line command line application with only minimal fixes in 30 minutes.

@sachaarbonel
sachaarbonel / inspect.go
Created March 12, 2019 17:46 — forked from FingerLiu/inspect.go
inspect json and generate graphql schema
package main
/*
parse json, extract type in json and save to graphql.schema
*/
import (
"io/ioutil"
"encoding/json"
"reflect"
"fmt"
@sachaarbonel
sachaarbonel / gist:5104146cab136dba43c3b0a0fe7cd925
Created March 2, 2019 12:23 — forked from sartak/a.md
Anki 2 annotated schema
-- see https://github.com/ankidroid/Anki-Android/wiki/Database-Structure for a more maintained version of this
-- cards are what you review. easy!
CREATE TABLE cards (
id integer primary key,
-- the epoch milliseconds of when the card was created
nid integer not null,
-- notes.id
did integer not null,
-- deck id (available in col table)