View Dict.coffee
class Dict
constructor: (@g, @dict) ->
@missings = []
resolve: (content, showErrors=true, json=false, englishFallback=true) ->
fail = false
RE = if json then /"\{([^}^\s]+)\}"/g else /\{([^}^\s]+)\}/g
content = content.replace RE, (m, n) =>
replacement = @t n, showErrors, true, englishFallback
fail or= not replacement?
View confirm.sh
# ======================================================================
#
# @link http://wuhrr.wordpress.com/2010/01/13/adding-confirmation-to-bash/#comment-3540
#
# Function: confirm
# Asks the user to confirm an action, If the user does not answer "This won't shutdown the Internet!" the script will immediately exit.
#
# Parameters:
# $@ - The confirmation message
#
View ExecuteOnSave.sublime-settings
{
"filter_execute": {
"\\.coffee$": {
"cmd": "webpack-versioner.sh $file $file_path/versions.manifest.json",
"shell": true
}
},
"build_on_save": 1
}
View scss-lint.py
import re
from base_linter import BaseLinter
CONFIG = {
'language': 'SCSS',
'executable': 'scss-lint.sh',
'lint_args': '{filename}'
}
View propuesta.txt
// ahora
diccionarios = [channel_][territory_]language
templates = [channel_][territory_]language
configuraciones = [channel_]territory[_language]
// propuesta
The locale naming convention is:
language[_territory][.codeset][@modifier]
where a two-letter language code is from ISO 639, a two-letter territory code is
from ISO 3166, codeset is the name of the codeset that is being used in the
View app.coffee
express = require 'express'
skipper = require 'skipper'
nodemailer = require 'nodemailer'
app = express()
verifyToken = (req, res, next) ->
token = req.body.token || req.query.token || req.headers['x-access-token']
if token is process.env.TOKEN
next()
else
View jruby+jdbc.rb
#!/usr/bin/env ruby
# coding: UTF-8
require "./db2jcc4.jar"
require "./db2jcc_license_cu.jar"
query = <<-eos
select 'hello' as foo, 'world' as bar
from sysibm.sysdummy1
eos
View export-todos.rb
#!/usr/bin/env ruby
# coding: UTF-8
require "logger"
require "pp"
require "yaml"
require "active_support/inflector"
logger = Logger.new $stderr
logger.level = Logger.const_get ENV.fetch "LOG_LEVEL", "INFO"
View main.es6
import express from "express"
var app = express();
app.get("/", (req, res) => {
res.json({hello: 'world'});
});
var port = process.env.PORT || 3000;
View life.rb
board = """
........................o...........
......................o.o...........
............oo......oo............oo
...........o...o....oo............oo
oo........o.....o...oo..............
oo........o...o.oo....o.o...........
..........o.....o.......o...........
...........o...o....................
............oo......................