Skip to content

Instantly share code, notes, and snippets.

puts %{This script checks the main locale of a PhraseApp project for translations with copy changes and then adds the tag retranslate_<locale_code> to keys which translation has not changed since the copy change of its source.
It only includes verified main locale translations.
If it finds a newer change in the target language it removes the tag retranslate_<locale_code> again.
e.g. change in main locale en-GB, key is tagged retranslate_de, translator adapts (or verifies/unverifies) German translation, key tag retranslate_de is removed.
It takes the parameters via ENV:
PHRASEAPP_ACCESS_TOKEN=abc123
var webpack = require('webpack')
var PROD = (process.env.NODE_ENV === 'production')
module.exports = {
entry: ["./src/phrase.ts", "./src/directives/phrase_javascript.ts"],
output: {
filename: PROD ? "angular-phrase.min.js" : "angular-phrase.js",
path: __dirname + "/dist"
},
devtool: 'source-map',
@fredv
fredv / Some Japanese and Chinese (Business) Terminology.md
Last active May 9, 2016 16:22
Some notes I took from a presentation of Rochelle Kopp at LocWorld Tokyo

Japanese

Kanji / Hiragana / Romaji

無駄 (むだ) Muda

Waste

安定 (あんてい) Antei

Stability; Predictability

@fredv
fredv / .tmux.conf
Created November 26, 2015 17:17
.tmux.conf
#ChrisJohnson/tmux-MacOSX-pasteboard
#set-option -g default-command "reattach-to-user-namespace -l zsh"
set -g repeat-time 1000
set -s escape-time 1
set -g base-index 1
set -g pane-base-index 1
set-option -g prefix C-a
set-option -g history-limit 10000
@fredv
fredv / .vimrc
Created November 26, 2015 17:17
.vimrc
filetype plugin off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'fatih/vim-go'
Plugin 'tpope/vim-fugitive'
Plugin 'rking/ag.vim'
Plugin 'scrooloose/syntastic'
Plugin 'kien/ctrlp.vim'
Plugin 'Rip-Rip/clang_complete'
@fredv
fredv / ES_quoted_query_not_analyzed
Created July 23, 2014 09:22
ElasticSearch query_string parsing quotes on not_analyzed field vs. standard tokenizer
PUT http://localhost:9200/_template/txt
{
"template": "index_dev",
"order": 0,
"mappings": {
"_default_": {
"dynamic_templates": [
{
"template_txt": {
"mapping": {
@fredv
fredv / vimux.md
Last active July 5, 2021 10:15
Vimux Start
import (
"github.com/dynport/urknall"
"github.com/dynport/urknall/cmd"
)
func helloWorld (p urknall.Package) {
p.AddCommands("run", cmd.Shell("echo hello world"));
}
func main() {

Keybase proof

I hereby claim:

  • I am fredv on github.
  • I am frederik (https://keybase.io/frederik) on keybase.
  • I have a public key whose fingerprint is 61C1 D425 AEE0 42F6 5C4D 3060 038B 40D5 2F87 1B99

To claim this, I am signing this object:

@fredv
fredv / gist:3098462
Created July 12, 2012 14:30
Solr instrumentation for Supernova after Michael Nutt
module SolrInstrumentation
class LogSubscriber < ActiveSupport::LogSubscriber
def query(event)
self.class.runtime += event.duration
return unless logger.debug?
name = '%s (%.1fms)' % ["SOLR Query", event.duration]
# produces: 'query: "foo" OR "bar", rows: 3, ...'
query = event.payload[:query].map{ |k, v| "#{k}: #{color(v, BOLD, true)}" }.join(', ')