Skip to content

Instantly share code, notes, and snippets.

View studentIvan's full-sized avatar
🎯
Focusing

Ivan Maslov studentIvan

🎯
Focusing
View GitHub Profile
@studentIvan
studentIvan / gist:1519751
Created December 25, 2011 21:07
city of russia
cityData = ["\u041c\u043e\u0441\u043a\u0432\u0430","\u0410\u0431\u0440\u0430\u043c\u0446\u0435\u0432\u043e","\u0410\u043b\u0430\u0431\u0438\u043d\u043e","\u0410\u043f\u0440\u0435\u043b\u0435\u0432\u043a\u0430","\u0410\u0440\u0445\u0430\u043d\u0433\u0435\u043b\u044c\u0441\u043a\u043e\u0435","\u0410\u0448\u0438\u0442\u043a\u043e\u0432\u043e","\u0411\u0430\u0439\u043a\u043e\u043d\u0443\u0440","\u0411\u0430\u043a\u0448\u0435\u0435\u0432\u043e","\u0411\u0430\u043b\u0430\u0448\u0438\u0445\u0430","\u0411\u0430\u0440\u044b\u0431\u0438\u043d\u043e","\u0411\u0435\u043b\u043e\u043e\u043c\u0443\u0442","\u0411\u0435\u043b\u044b\u0435 \u0421\u0442\u043e\u043b\u0431\u044b","\u0411\u043e\u0440\u043e\u0434\u0438\u043d\u043e","\u0411\u0440\u043e\u043d\u043d\u0438\u0446\u044b","\u0411\u044b\u043a\u043e\u0432\u043e","\u0412\u0430\u043b\u0443\u0435\u0432\u043e","\u0412\u0435\u0440\u0431\u0438\u043b\u043a\u0438","\u0412\u0435\u0440\u0435\u044f","\u0412\u0438\u0434\u043d\u043e\u0435","\u0412\u043d\u0443\u043a\u043e\u0432\u043e","\u
@studentIvan
studentIvan / gist:1701919
Created January 30, 2012 01:54
Simple unicode in Doctrine 2 Schema createTable
<?php
use \Doctrine\DBAL\Schema\Schema;
use \Doctrine\DBAL\Schema\Table;
class UnicodeSchema extends Schema
{
/**
* Create schema table with specific encoding
*
* @param string $tableName
@studentIvan
studentIvan / chessboard.pas
Created March 13, 2012 18:30
pascal chess board drawing
USES CRT, GRAPH;
VAR
gd, gm: integer;
x, y: integer;
{chess_board}
c_offset, c_side, c_step,
c_cursor_x, c_cursor_y,
c_cl_black, c_cl_white,
c_pixels_offset: integer;
@studentIvan
studentIvan / chess.coffee
Created March 15, 2012 23:08
Batman Chess
###
* Batman Chess
* By github.com/studentIvan
###
class Player
selectedCell: 0
isComputer: false
myTurn: false
myColor: 'white'
board: 0
@studentIvan
studentIvan / EasyTree.php
Created September 24, 2013 16:36
EasyTree php tree build algorithm
<?php
/**
* 1. This Algorithm can help you build tree as a nested php array from array like ('id' => x, 'parent_id' => y)
* 2. Algorithm speed = {O(n log n) + О(N)}
*/
class EasyTree
{
public static
$idKeyName = 'id', $parentIdKeyName = 'parent_id', $childrenKeyName = 'children';
@studentIvan
studentIvan / gist:6886398
Created October 8, 2013 15:20
/test new GDPhoto testing
<?php
class Common extends Services
{
public static function test()
{
try
{
Process::load('GDPhoto');
$uniqueId = 95;
$photo = new GDPhoto();
@studentIvan
studentIvan / up.php
Last active December 27, 2015 01:49
php download manager for vk.com music (for savefrom.net extension -> get all mp3 links)
<?php
$links = <<<EOL
https://psv4.vk.me/c536213/u23259354/audios/6622030b9956.mp3
https://psv4.vk.me/c6086/u3197020/audios/d0a867f54401.mp3
https://cs9-6v4.vk.me/p13/e2886ae987e8c5.mp3
https://psv4.vk.me/c6182/u211520772/audios/6ec1531bd181.mp3
https://psv4.vk.me/c536610/u886918/audios/0e3ad42b151d.mp3
https://psv4.vk.me/c6178/u47402845/audios/d45d27698600.mp3
https://cs9-6v4.vk.me/p13/17e4437ffe0922.mp3
https://psv4.vk.me/c6098/u2294877/audios/990035362c3a.mp3
@studentIvan
studentIvan / main.css
Created January 22, 2015 22:02
Комплект стилей для приложения todo-list (спасибо https://github.com/shuhei/material-colors)
/**
* http://www.google.com/design/spec/style/color.html#color-color-palette
* thanks to https://github.com/shuhei/material-colors
*/
@font-face {
font-family: 'Roboto Medium';
src: url('../fonts/Roboto-Regular.ttf') format('truetype');
}
@font-face {
font-family: 'Roboto Light';
#!/bin/bash
cd ~/my/project/backend/
source ~/.virtualenvs/myenv/bin/activate
PS1="\u@\h:\w\$ "
echo -ne "\033]0;Django Backend Server\007"
./manage.py runserver
read -p "Press any key..."
.idea
*.pyc
.DS_Store