Skip to content

Instantly share code, notes, and snippets.

View adam-singer's full-sized avatar
👾

Adam Singer adam-singer

👾
View GitHub Profile
@mr-salty
mr-salty / clean-bazel-cache.sh
Last active January 21, 2024 21:55
script to clean up files in the bazel cache
#! /bin/bash -e
#
# clean up everything in CACHE_DIR last accessed more than DAYS days ago.
# also removes files with bogus timestamps in the future.
#
# -----------------------------------------------------------------------
# Copyright 2021 Todd Derr (todd.derr@gmail.com)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@lazywithclass
lazywithclass / blog-post.md
Last active April 24, 2024 00:38
Looking at the most beautiful program ever written - part 1

Looking at the most beautiful program ever written - part 1

I am going to have a look at what William Byrd presented as The most beautiful program ever written.

Beauty here refers to computer programs, specifically about Lisp. There might be errors as this is something I wrote to make sense of that interpreter, proceed at your own risk.

Thanks a lot to Carl J. Factora for the help.

The program

@danielalvarenga
danielalvarenga / terminal-colors-branch.sh
Last active March 27, 2024 17:34
Show branch in terminal Ubuntu
# Add in ~/.bashrc or ~/.bash_profile
function parse_git_branch () {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
RED="\[\033[01;31m\]"
YELLOW="\[\033[01;33m\]"
GREEN="\[\033[01;32m\]"
BLUE="\[\033[01;34m\]"
NO_COLOR="\[\033[00m\]"
@vsavkin
vsavkin / angular_dart_rest_client_spike.md
Last active August 29, 2015 14:02
AngularDart REST Client

Hammock

I released a library based on this spike. You you can find it here: https://github.com/vsavkin/hammock.

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.

anonymous
anonymous / gist:58c2395eef9daf6be7e8
Created June 12, 2014 08:39
dart_sfml test
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include "include/dart_api.h"
#include <SFML/Audio.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/OpenGL.hpp>
#include <SFML/Window.hpp>
@nicokosi
nicokosi / progfun04
Last active November 16, 2018 01:51
My notes from Coursera course "Functional Programming Principles in Scala" (https://class.coursera.org/progfun-004).
Notes from Coursera course 'Functional Programming Principles in Scala":
https://class.coursera.org/progfun-004
✔ Week 1: Functions & Evaluations @done (14-05-01 17:20)
✔ Lecture 1.1 - Programming Paradigms (14:32) @done (14-04-27 17:54)
3 paradigms: imperative, functional, logic
OO: orthogonal
imperative:
@adam-singer
adam-singer / dart-deploy-script.sh
Created March 21, 2014 05:32
Example of deploying dart to google compute engine without having to compile the dart-sdk from source.
#!/usr/bin/env bash
set +o xtrace
USER=$USER
PROJECT=dart-compute-project
INSTANCE_NAME=dart-compute
TAGS=dart
MACHINE_TYPE=f1-micro
NETWORK=default
IP=ephemeral
@damondouglas
damondouglas / Angular-Dart-Check-Lists.md
Last active April 27, 2017 06:45
Angular Dart Check Lists

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

@munificent
munificent / gist:8700021
Created January 30, 2014 00:12
A new pub command?

I'm starting to work on a new pub command. I've got two goals for it.

Use case 1: Pre-populating your cache (bug #16265)

The first is that it can be used to install a package into your system cache. For example, maybe you're about to go off the grid and you want to make sure you have a bunch of stuff cached locally before you fall off the Internet. pub get does this implicitly, of course, but you may not have any packages that depend on the stuff you're downloading. You just want to pull it down.

Our specific use case is that we are starting to run tests of packages. Since hitting the network can fail, we'd like to do that separately from running pub get so that we can handle the failure more gracefully.

The idea is you could do:

@sma
sma / README.md
Last active July 4, 2023 06:28
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.