Skip to content

Instantly share code, notes, and snippets.

View adam-singer's full-sized avatar
👾

Adam Singer adam-singer

👾
View GitHub Profile
@adam-singer
adam-singer / frontendDevlopmentBookmarks.md
Last active January 21, 2016 03:07 — forked from dypsilon/frontendDevlopmentBookmarks.md
A badass list of frontend development resources I collected over time.
// http://en.wikipedia.org/wiki/Bridge_pattern
trait DrawingAPI {
def drawCircle(x:Double, y: Double, radius:Double)
}
class DrawingAPI1 extends DrawingAPI {
override def drawCircle(x: Double, y: Double, radius: Double) = {
printf("API1.circle at %f:%f radius %f\n", x, y, radius)
}
#!/bin/sh
# one way (older scala version will be installed)
# sudo apt-get install scala
#2nd way
sudo apt-get remove scala-library scala
wget www.scala-lang.org/files/archive/scala-2.10.3.deb
sudo dpkg -i scala-2.10.3.deb
sudo apt-get update

SPIKE: AngularDart REST Client

Every client-side applications has to talk to REST APIs. At the moment AngularDart does not provide any high-level abstractions to help you do that. You can send http requests, but that's it.

This post is about a spike I did a few days ago to explore possible ways of building such a library. It also shows that you can do quite a bit in just one hundred lines of Dart.

Design Principles

alias gdbnew='/usr/local/Cellar/gdb/7.6/bin/gdb'

You might want to read this to get an introduction to armel vs armhf.

If the below is too much, you can try Ubuntu-ARMv7-Qemu but note it contains non-free blobs.

Running ARM programs under linux (without starting QEMU VM!)

First, cross-compile user programs with GCC-ARM toolchain. Then install qemu-arm-static so that you can run ARM executables directly on linux

Angular Dart Check List

The following shows what to watch out for when making Angular Dart applications. For more information about Angular Dart, see angulardart.org.

Table Of Contents

@adam-singer
adam-singer / README.md
Created December 31, 2013 04:35 — forked from sma/README.md

Java to Dart

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

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). You will have to make changes to the resulting Dart code.

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

Because Dart doesn't support overloading methods, I strongly recommend to first rename (using your favorite IDE) those methods in Java. I also noticed that Dart doesn't like if types, fields, or methods have the same name. Again, I recommend to rename all such occurrences before translating.

/*
I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace
so it's better encapsulated. Now you can have multiple random number generators
and they won't stomp all over eachother's state.
If you want to use this as a substitute for Math.random(), use the random()
method like so:
var m = new MersenneTwister();