Skip to content

Instantly share code, notes, and snippets.

@bromzh
bromzh / package.json
Created July 14, 2016 12:08
Webpack configs
{
"name": "cardspro-bo-web",
"version": "0.1.0",
"description": "CardsPro Back Office",
"author": "Vladimir Krylov <vkrylov@iqcard.ru>",
"homepage": "https://github.com/IQCard/iqcard-web/cardspro-bo-web",
"license": "WTFPL",
"scripts": {
"clean": "rimraf typings dist",
"clean:dist": "rimraf dist",
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bromzh
bromzh / bash-prompt.sh
Last active February 25, 2016 16:53
Bash prompt. Put this to ~/.bashrc
# Reset
Color_Off="\[\033[0m\]" # Text Reset
# Regular Colors
Black="\[\033[0;30m\]" # Black
Red="\[\033[0;31m\]" # Red
Green="\[\033[0;32m\]" # Green
Yellow="\[\033[0;33m\]" # Yellow
Blue="\[\033[0;34m\]" # Blue
Purple="\[\033[0;35m\]" # Purple
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@bromzh
bromzh / safe_str_fmt.py
Last active August 29, 2015 14:10
Safe string formatting with dict
# Only for python >= 3.2
# Source: https://docs.python.org/3/library/stdtypes.html#str.format_map
class Default(dict):
def __missing__(self, key):
return '---'
# Usage
s = 'foo -> {foo}; bar -> {bar}'.format_map(Default(foo=42, qux=True))
print(s)
File Spec Place
application.xml Java EE META-INF
application-client.xml Java EE META-INF
beans.xml CDI META-INF or WEB-INF
ra.xml JCA META-INF
ejb-jar.xml EJB META-INF or WEB-INF
faces-config.xml JSF WEB-INF
persistence.xml JPA META-INF
validation.xml Components validation META-INF or WEB-INF
@bromzh
bromzh / mongoengine_serializer.py
Last active August 29, 2015 14:05
This is a simple serializer for MongoEngine Documents supports black and white lists, name mapping and methods/properties includes.
# -*- coding: utf-8 -*-
import datetime
import calendar
import re
import base64
import bson
from bson import RE_TYPE
from bson.binary import Binary
from bson.code import Code
from bson.dbref import DBRef