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
test
#include<stdio.h>
int main()
{
int i,j,k;
int h=7,t=3,l=5;
for(i=1;i<=(t/2)+1;i++)
{
for(j=1;j<=i;j++)
{
printf("*");
@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>
@startuml
'autonumber
hide footbox
participant "Client" as C
participant "SSO\nServer" as S
participant "Hadoop\nService" as H
C->S: 1. credentials
C<--S: tokens
C->H: 2. access token
C<--H: requested resource
@mishin
mishin / plant.puml
Last active October 22, 2017 03:33
@startuml
/' Styles ----------------------------------------------------------------
Installing plantuml is easy, you can do it through maven!
# Get the plantuml jar.
mvn dependency:get -Dartifact=net.sourceforge.plantuml:plantuml:8045
# Alias to run.
alias plantuml='java -DPLANTUML_LIMIT_SIZE=8192 -jar ~/.m2/repository/net/sourceforge/plantuml/plantuml/8045/plantuml-8045.jar'
@mishin
mishin / test.puml
Last active May 29, 2018 17:47
test.puml
@startuml
skinparam lifelineStrategy solid
skinparam handwritten false
skinparam monochrome true
skinparam packageStyle rect
skinparam defaultFontName FG Virgil
skinparam shadowing true
skinparam classBorderThickness .5
skinparam usecaseBorderThickness .5
skinparam titleBorderRoundCorner 15
@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 };