Skip to content

Instantly share code, notes, and snippets.

View alapini's full-sized avatar
🎯

Luc Alapini alapini

🎯
View GitHub Profile
public class MyApp extends Application {
@Override
public void onCreate() {
TypefaceUtil.overrideFont(getApplicationContext(), "SERIF", "fonts/Roboto-Regular.ttf"); // font from assets: "assets/fonts/Roboto-Regular.ttf
}
}
package net.colaborativa.exampleapp.api;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
@alapini
alapini / browserify_for_webpack_users.markdown
Created October 2, 2016 07:25
browserify for webpack users

browserify for webpack users

There's been a strange explosion in misinformation about browserify recently, particularly in comparisons to webpack.

Generally speaking, most of this confusion stems from how webpack is more willing to pull features into its core to ease discoverability while browserify is more likely to push features out to userland instead.

I think that longer-term, separability has more benefits from a maintenance and

@alapini
alapini / interface.go
Created January 2, 2017 18:40 — forked from icambridge/interface.go
Observer pattern - golang
type TestCallBack struct {
}
func (c *TestCallBack) Exec(o *Observable) {
log.Println(o.Name)
}
type Callback interface {
Exec(h *Observable)
@alapini
alapini / letsencrypt-autogen.sh
Created June 29, 2017 08:13 — forked from kevincharm/letsencrypt-autogen.sh
CentOS 7 Let's Encrypt SSL certs
#!/bin/bash
# Automates letsencrypt SSL cert generation/installation on CentOS 7 w/nginx
# MIT, use at your own risk blabla
EMAIL=foo@bar.com
DOMAIN_NAME=foo.bar.com
sudo su - root
cd ~
git clone https://github.com/letsencrypt/letsencrypt
@alapini
alapini / index.ios.js
Created August 3, 2017 12:19 — forked from Jpoliachik/index.ios.js
ReactNative LayoutAnimation Example
'use strict';
import React, {
AppRegistry,
Component,
StyleSheet,
Text,
View,
TouchableOpacity,
LayoutAnimation,
} from 'react-native';
@alapini
alapini / twitterbot.md
Created August 18, 2017 15:32 — forked from aparrish/twitterbot.md
Make-A-Twitter-Bot Workshop
@alapini
alapini / main.go
Created August 22, 2017 19:54 — forked from jinzhu/main.go
handle postgres json with gorm
package main
import (
"fmt"
"github.com/jinzhu/gorm"
_ "github.com/lib/pq"
)
func main() {
@alapini
alapini / slicemap_test.go
Created August 24, 2017 07:53 — forked from grahamking/slicemap_test.go
Benchmark comparing map access vs slice search
package main
import (
"math/rand"
"testing"
"time"
)
const (
numItems = 100 // change this to see how number of items affects speed
@alapini
alapini / phantom-footer.js
Created August 24, 2017 09:57
Phantom js print header and footer