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
@jpotterm
jpotterm / main.dart
Last active March 23, 2022 22:35
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;
}
@arno01
arno01 / docker-on-android.md
Last active April 2, 2025 03:08
Docker on Android

WORK IN PROGRESS

Docker on Android

Setup:

Samsung Galaxy Tab S5e SM-T720
Android Pie on Linux 4.9.112 (not rooted)
Termux
@ChetanBhasin
ChetanBhasin / ws_pub_sub.rs
Last active March 20, 2024 22:27
Rust web socket pub-sub example (very minimal)
extern crate websocket;
use std::thread;
use std::sync::Arc;
use std::sync::Mutex;
use std::sync::mpsc::{Sender, Receiver};
use std::sync::mpsc;
use websocket::Message;
use websocket::stream::sync::TcpStream;
use websocket::sync::{Server, Client};
@aloisdeniel
aloisdeniel / stream_vs_valuelistenable.dart
Last active April 17, 2021 20:14
This example shows how, in a majority of cases, Streams cause unnecessary rebuilds in initial state.
import 'package:flutter/material.dart';
import 'package:rxdart/rxdart.dart';
// Global application configuration and navigation
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) => MaterialApp(home: Home());
@graphicbeacon
graphicbeacon / index.html
Last active May 20, 2020 14:13
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" />
@gbuela
gbuela / animation_card.dart
Created April 3, 2019 23:46
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});
@mikowl
mikowl / oneliners.js
Last active February 19, 2025 05:20
👑 Awesome one-liners you might find useful while coding.
// Inspired by https://twitter.com/coderitual/status/1112297299307384833 and https://tapajyoti-bose.medium.com/7-killer-one-liners-in-javascript-33db6798f5bf
// Remove any duplicates from an array of primitives.
const unique = [...new Set(arr)]
// Sleep in async functions. Use: await sleep(2000).
const sleep = (ms) => (new Promise(resolve => setTimeout(resolve, ms)));
// or
const sleep = util.promisify(setTimeout);
// BLOC
class ErrorBloc extends Bloc<ErrorBlocEvent, ErrorBlocState> {
@override
Stream<ClaimState> mapEventToState(ErrorBlocState currentState, ErrorBlocEvent event) async* {
if (event is SomeEvent) {
yield Processing();
final result = await _doSomething();
if(result.success) {
yield Success();
@ikegami-yukino
ikegami-yukino / translate_sentiwordnet.py
Last active May 10, 2019 10:45
SentiWordNet を日本語化する
import re
import sqlite3
import time
import requests
DB_PATH = 'wnjpn.db'
SWN_PATH = 'SentiWordNet_3.0.0_20130122.txt'
URL = 'https://script.google.com/macros/s/Please_write_here/exec?text=%s&source=en&target=ja'
RESULT_PATH = 'result.csv'
@FingerLiu
FingerLiu / inspect.go
Created January 26, 2019 14:54
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"