Skip to content

Instantly share code, notes, and snippets.

@jackgris
jackgris / DOCKERFILE
Created August 10, 2023 22:17 — forked from MatthewJamesBoyle/DOCKERFILE
production go dockerfile
FROM golang:1.21.0-bullseye as builder
COPY . /workdir
WORKDIR /workdir
ENV CGO_CPPFLAGS="-D_FORTIFY_SOURCE=2 -fstack-protector-all"
ENV GOFLAGS="-buildmode=pie"
RUN go build -ldflags "-s -w" -trimpath ./cmd/app
@jackgris
jackgris / Notes-about-versioning-Go.md
Created August 2, 2023 21:54
Versioning Go binaries

With a code like this:

package main

import "fmt"

var (
	version = "dev"
	commit = "n/a"
@jackgris
jackgris / japanese_chinese_input_in_manjaro.md
Last active September 22, 2020 13:05 — forked from jasonzhouu/chinese_input_in_manjaro.md
Config Chinese and Japanese input method in Manjaro

1. Install packages

run:

yay -S adobe-source-han-sans-otc-fonts adobe-source-han-serif-otc-fonts  adobe-source-han-sans-jp-fonts otf-ipafont
yay -S ttf-monapo

Make sure you have commented out (add # to comment out) the following line in /etc/locale.gen file.

#ja_JP.UTF-8
@jackgris
jackgris / ActionBarHeight.java
Created October 24, 2014 15:11
How get height of ActionBarCompact
// Get height action bar compat
TypedValue tv = new TypedValue();
int attr = android.support.v7.appcompat.R.attr.actionBarSize;
if (getTheme().resolveAttribute(attr, tv, true)){
int actionBarHeight = TypedValue.complexToDimensionPixelSize(tv.data,getResources().getDisplayMetrics());
Log.w("ACTIONBAR", "height - " + actionBarHeight);
}
@jackgris
jackgris / gist:a62b65d673c6f8cf05fb
Last active April 29, 2021 23:29 — forked from necrobious/gist:14d78ee9b4caff766152
How install GHC and Cabal on Ubuntu
# build with
# docker build -t 'necrobious/haskell-ghc-7.8-64' .
FROM ubuntu:14.04
MAINTAINER [email protected]
ENV DEBIAN_FRONTEND noninteractive
####### Install Dependencies ###################################################
RUN apt-get -y update
@jackgris
jackgris / config.fish
Last active April 13, 2019 13:48
Example of config for fish shell
## Lenguaje Go
set --export GOROOT /usr/local/go
set -gx PATH /usr/local/go/bin $PATH
#set -gx PATH GOROOT/bin $PATH
set --export GOPATH $HOME/GoProjects
set -gx PATH $GOPATH/bin $PATH
## AppEngine para GO
set -gx PATH $HOME/programs/go_appengine $PATH
@jackgris
jackgris / build.gradle
Created June 6, 2014 18:51
Example of use from Proguard, from Android Studio
buildscript {
repositories {
mavenCentral()
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:0.9.+'
classpath 'com.squareup.gradle:gradle-android-test-plugin:0.9.1-SNAPSHOT'
@jackgris
jackgris / MyHausdorffDistanceImpl.java
Created April 15, 2014 17:35
Hausdorff distance, calculating similar polygons
/**
* This method will be used to calculate the Hausdorff distance
*
* @param distanceMax this is the value of the maximum distance to compare
* @param routeOne this is one of the routes to compare
* @param routeTwo this is one of the routes to compare
* @return returns true if the value of the maximum distance is not exceeded, false otherwise
*/
public boolean distanceHausdorff(final int distanceMax, LinkedList<Posicion> routeOne,
LinkedList<Posicion> routeTwo) {
@jackgris
jackgris / emacs
Last active December 17, 2017 13:06
Possible settings for Emacs, with support for the Go language and more
;; ;;(add-to-list 'auto-mode-alist '("\\.jsx\\'" . web-mode))
;; ;;(add-to-list 'auto-mode-alist '("\\.js\\'" . web-mode))
;; ;;(setq web-mode-content-types-alist '(("jsx" . "*\\.js[x]?\\'"))
;; ; Para que el demonio de emacs cargue nuestro archivo de configuración,
;; ; el comando de inicio debería ser algo así:
;; ;; emacs -u usuario --daemon -l ~/.emacs
(require 'package)
(package-initialize)
@jackgris
jackgris / .hgignore
Created December 12, 2013 15:02
This is one possible configuration, for ignoring files on Mercurial, on Android Studio
# use syntax glob for this file
syntax: glob
#archivos con extensiones de configuracion local del proyecto o compilados
*.class
*.apk
*.dex
*.ap_
*.suo
*.properties