Skip to content

Instantly share code, notes, and snippets.

View mishin's full-sized avatar
💭
if you fail to prepare you prepare to fail

Nikolay Mishin mishin

💭
if you fail to prepare you prepare to fail
View GitHub Profile
@mishin
mishin / example.puml
Created October 28, 2017 18:38 — forked from QuantumGhost/example.puml
A simple template for PlantUML to draw ER diagram. The basic idea comes from http://plantuml.sourceforge.net/qa/?qa=331/database-modeling
@startuml
' uncomment the line below if you're using computer with a retina display
' skinparam dpi 300
!define Table(name,desc) class name as "desc" << (T,#FFAAAA) >>
' we use bold for primary key
' green color for unique
' and underscore for not_null
!define primary_key(x) <b>x</b>
!define unique(x) <color:green>x</color>
!define not_null(x) <u>x</u>
@mishin
mishin / jinja2_file_less.py
Created September 22, 2017 13:33 — forked from wrunk/jinja2_file_less.py
python jinja2 examples
#!/usr/bin/env/python
#
# More of a reference of using jinaj2 without actual template files.
# This is great for a simple output transformation to standard out.
#
# Of course you will need to "sudo pip install jinja2" first!
#
# I like to refer to the following to remember how to use jinja2 :)
# http://jinja.pocoo.org/docs/templates/
#
@mishin
mishin / moremojo.txt
Created March 1, 2017 07:15 — forked from anonymous/moremojo.txt
Beginnings of a Mojolicious Tutorial
=head1 TUTORIAL
A quick example driven introduction to the wonders of L<Mojolicious>.
=head2 Hello World Generator
A simple Hello World application can be constructed in a few commands.
$ mojo generate app Eg
[mkdir] .../eg/script
#!/usr/bin/env perl
use Mojolicious::Lite;
# connect to database
use DBI;
my $dbh = DBI->connect("dbi:SQLite:database.db","","") or die "Could not connect";
# shortcut for use in template
helper db => sub { $dbh };
@mishin
mishin / commit.push.build.sh
Created November 25, 2016 17:27 — forked from boyron/commit.push.build.sh
Commit, push and build at once
#!/bin/bash
# @see http://www.ittybittytalks.com/commit-push-trigger-jenkins-build/
git commit -a -m "$1"
git push
curl --user <your_jenkins_username>:<your_jenkins_API_key> http://<jenkins_server_url>/job/<your_jenkins_job_name>/build
@mishin
mishin / idebug-demo.psgi
Created September 19, 2016 17:14 — forked from yko/idebug-demo.psgi
PSGI InteractiveDebugger demo
#!/usr/bin/env perl
use strict;
use warnings;
use Plack::Builder;
my $body = join '', <DATA>;
my $app = sub {
my $self = shift;
@mishin
mishin / todo.t
Created September 5, 2016 13:22 — forked from dallaylaen/todo.t
Make Perl module developer feel bad about untested code
#!/usr/bin/env perl
# This script tests nothing (except the fact that modules load w/o warnings).
# However, it tries to load them all.
# This means that untested modules would also be included into
# code coverage summary, lowering total coverage to its actual value.
# I.e. having a well-covered module and a totally uncovered one will result
# in 50% coverage which is probably closer to truth.
@mishin
mishin / findauthors.sh
Created August 22, 2016 12:09 — forked from stefanfoulis/findauthors.sh
How to sync svn to git
#!/usr/bin/env bash
# Run this script inside a SVN checkout of the project
authors=$(svn log -q | grep -e '^r' | awk 'BEGIN { FS = "|" } ; { print $2 }' | sort | uniq)
for author in ${authors}; do
echo "${author} = NAME <USER@DOMAIN>";
@mishin
mishin / .ackrc
Created August 17, 2016 06:11 — forked from hernamesbarbara/.ackrc
Example configuration for using Ack to search file tree
#ack is a tool like grep, designed for programmers with large trees of heterogeneous source code
#to install ack, see http://betterthangrep.com/
#to use ack, launch terminal (mac osx) and type 'ack <some_keywords>'
#ack will search all files in the current directory & sub-directories
#here's how I have my config file setup. this file is located on mac osx here
# ~/.ackrc
# Always sort the files
@mishin
mishin / HelloWorld.java
Created July 25, 2016 16:20 — forked from lolzballs/HelloWorld.java
Hello World Enterprise Edition
import java.io.FileDescriptor;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
public class HelloWorld{
private static HelloWorld instance;
public static void main(String[] args){
instantiateHelloWorldMainClassAndRun();