Skip to content

Instantly share code, notes, and snippets.

View miquelbeltran's full-sized avatar

Miguel Beltran miquelbeltran

View GitHub Profile
@miquelbeltran
miquelbeltran / main.dart
Created March 3, 2021 17:02 — forked from kwalrath/main.dart
Java-to-Dart codelab: CircleMock example
import 'dart:math';
abstract class Shape {
factory Shape(String type) {
if (type == 'circle') return Circle(2);
if (type == 'square') return Square(2);
throw 'Can\'t create $type.';
}
num get area;
}
@miquelbeltran
miquelbeltran / main.dart
Last active March 3, 2021 16:24 — forked from Sfshaza/main.dart
Java-to-Dart codelab: Basic bicycle example
class Bicycle {
late int cadence;
late int speed;
late int gear;
Bicycle(this.cadence, this.speed, this.gear);
@override
String toString() => 'Bicycle: $speed mph';
}
@miquelbeltran
miquelbeltran / pre-push.sh
Last active June 4, 2019 06:53 — forked from chadmaughan/pre-commit.sh
A git pre commit hook that runs the test task with the gradle wrapper
#!/bin/sh
# this hook is in SCM so that it can be shared
# to install it, create a symbolic link in the projects .git/hooks folder
#
# i.e. - from the .git/hooks directory, run
# $ ln -s ../../git-hooks/pre-commit.sh pre-commit
#
# to skip the tests, run with the --no-verify argument
# i.e. - $ 'git commit --no-verify'
@miquelbeltran
miquelbeltran / album_downloader.py
Created October 9, 2012 14:21
Download all pictures from your facebook albums in subfolders
#Download all pictures from your facebook albums in subfolders
#uses https://github.com/pythonforfacebook/facebook-sdk
import facebook
import os
def download(url, folder):
"""Copy the contents of a file from a given URL
to a local file.
"""
@miquelbeltran
miquelbeltran / gist:3859125
Created October 9, 2012 14:20
Ubuntu installed software for development

Ubuntu installed software for development

Installed tools

  • sublime-text
  • Eclipse Classic
  • ADT + NDK + Android source code
  • Keepass
  • Filezilla
  • Skype