Skip to content

Instantly share code, notes, and snippets.

View DanGe42's full-sized avatar

Daniel Ge DanGe42

View GitHub Profile

Recipe for Brazilian Brigadeiros

Kika is one of our product managers, and you might know her as the Kika of Kika’s Treats, the San Francisco company whose chocolate-covered caramelized cookies used to sit on our shelves. Shortly after our Valencia Street café opened its doors in 2010 she did a pop-up in our pastry kitchen, and we’ve been dreaming of the baked goods and confections she made when she was behind the stoves ever since. Her Brazilian cheese bread? Legendary. Her fresh fig and chocolate ganache galette? We’d do anything for a crumb. But every time we’ve thought about her chocolatey, creamy brigadeiros (pronounced bree-guh-DAY-rows) over the years, we’ve gotten more than a little swoony.

Let us explain.. Brigadeiros are an extremely popular truffle-like confection from Kika’s native Brazil that everyone makes at home for parties or special occasions. They’re as popular as chocolate-chip cookies. Usually they’re overwhelmingly dense and sweet from concentrated sweetened condensed milk and sweet c

@DanGe42
DanGe42 / components.external-link.js
Last active August 7, 2019 21:09
A trailing whitespace riddle
@DanGe42
DanGe42 / controllers.application.js
Last active July 22, 2019 21:38
Route hooks evaluation order
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@DanGe42
DanGe42 / controllers.application.js
Last active July 13, 2019 01:29
belongsTo test
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember belongsTo test'
});
function getWhateverObject() {
return Promise.resolve({ getBooleanValue() { return true; } })
}
async function iNeedThisBoolean() {
const someObject = await getWhateverObject();
const fWhatever = someObject.getBooleanValue();
if (fWhatever) {
console.log("true");
} else {
@DanGe42
DanGe42 / command.sh
Created July 13, 2018 07:46
60fps timelapse scripts
ffmpeg \
-framerate 60 \ # input framerate = 60fps
-start_number 0000 \ # start at frame_0000.JPG
-i frame_%04d.JPG \ # image filename template
-s 2560x1440 \ # resolution
-r 60 \ # output framerate = 60fps
-crf 17 \ # constant rate factor (17-28 is a "sane" range; lower is less lossy)
-vcodec libx264 \
-pix_fmt yuv420p \ # Support Quicktime playback
timelapse.mp4
@DanGe42
DanGe42 / main.go
Created September 20, 2016 05:59
A go/crypto + protobuf sample
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"encoding/base64"
"errors"
"fmt"
"io"
def ((defined?(Moped::BSON) ? Moped::BSON : BSON)::ObjectId).legal?(s)
/\A\h{24}\z/ === s.to_s
end

Keybase proof

I hereby claim:

  • I am DanGe42 on github.
  • I am dge (https://keybase.io/dge) on keybase.
  • I have a public key whose fingerprint is 5647 BAF2 14D7 AE03 3D6E 5AF1 916F EE0D A965 FA3A

To claim this, I am signing this object:

@DanGe42
DanGe42 / SyncTest.java
Created February 6, 2014 06:51
A simple program showing Java synchronization behavior.
public class SyncTest {
public void test1(int x) throws InterruptedException {
synchronized (this) {
System.out.println("Entered guarded block");
if (x != 42) {
wait();
}
System.out.println("Done!");
}
}