Skip to content

Instantly share code, notes, and snippets.

View unacorbatanegra's full-sized avatar
💙
Fluttering

Nicolas Lopez unacorbatanegra

💙
Fluttering
View GitHub Profile
@roipeker
roipeker / levenshtein.dart
Created June 24, 2021 23:20
basic Dart's Levenshtein distance.
import 'dart:math' as math;
/// see https://en.wikipedia.org/wiki/Levenshtein_distance
void main() {
/// terms distance can be used as threshold value when you filter similar results.
/// if the number of "editions" is low, you can suppose a typo and provide the "similar"
/// result (maybe using the `int` distance as a sorting method).
print(levenshtein('sittin', 'sitting'));
print(levenshtein('casa', 'calle'));
}
@roipeker
roipeker / image_color_picker_widget.dart
Last active January 21, 2025 13:18
Basic image pixel color detection in Flutter (supports screenshots of the widget tree)
//////////////////////////////
//
// 2019, roipeker.com
// screencast - demo simple image:
// https://youtu.be/EJyRH4_pY8I
//
// screencast - demo snapshot:
// https://youtu.be/-LxPcL7T61E
//
//////////////////////////////
@Gaff
Gaff / DIY-VPN-with-docker.md
Created September 3, 2015 06:26
Become your own VPN provider in 15 minutes with Docker

It's VERY easy to setup your own VPN with docker. This guide assumes you're ok with operating a linux box but know nothing about docker. I'll break it down into 4 easy steps:

1. Setup a docker host

I'm using bithost, so the steps here are:

  • Sign up and pay them some bitcoins :)
  • Generate a pgp key (digitalocean have detailed instructions on this step)
  • Upload the key
  • Launch a new host - I used ubuntu 14.04 image, but any platform that support docker will work.
@yinhm
yinhm / auth.go
Created April 1, 2015 03:37
gin middleware for login via Google OAuth 2.0
// Copyright 2014 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,