Skip to content

Instantly share code, notes, and snippets.

View vitqst's full-sized avatar
🎯
Focusing

vitqst

🎯
Focusing
View GitHub Profile
/* CSS Document */
@charset "utf-8";
#container, .row {
width: 100%;
float: left;
color: #fff;
font-size: 30px;
}
.wrap {
max-width: 960px;
@vitqst
vitqst / MCV PHP
Last active November 24, 2015 14:29
+ ADMIN
- controller
- model
- view
+ public
- css
- js
- template
- admin
- site
<?php
class Model{
public $string;
public function __construct(){
$this->string = "Hello world" ;
}
}
class View{
private $model ;
private $controller ;
// CI_Controller.php
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Welcome extends CI_Controller {
public function index()
{
$this->home() ;
}
public function home(){
@vitqst
vitqst / student.py
Last active December 7, 2015 14:46
lloyd = {
"name": "Lloyd",
"homework": [90.0, 97.0, 75.0, 92.0],
"quizzes": [88.0, 40.0, 94.0],
"tests": [75.0, 90.0]
}
alice = {
"name": "Alice",
"homework": [100.0, 92.0, 98.0, 100.0],
"quizzes": [82.0, 83.0, 91.0],
from random import randint
board = []
for x in range(5):
board.append(["O"] * 5)
def print_board(board):
for row in board:
print " ".join(row)
#connect to postgres
import psycopg2
try:
conn = psycopg2.connect("dbname='databasename' user='user_name' host='localhost' password='pass'")
except:
print ("I am unable to connect to the database")
cur = conn.cursor()
cur.execute("SELECT * FROM table") #query
set mypath=%~dp0
if not exist "%mypath%AI" mkdir "%mypath%AI"
if not exist "%mypath%IMAGES" mkdir "%mypath%IMAGES"
if not exist "%mypath%ICON" mkdir "%mypath%ICON"
if not exist "%mypath%PSD" mkdir "%mypath%PSD"
if not exist "%mypath%DOC" mkdir "%mypath%DOC"
if not exist "%mypath%VIDEO" mkdir "%mypath%VIDEO"
if not exist "%mypath%RAR" mkdir "%mypath%RAR"
set mypath=%~dp0
REM Create DIR
for %%f in (AI IMAGES PSD ICON DOC APP RAR EXE OTHER) do (if not exist "%mypath%%%f" mkdir "%mypath%%%f")
REM do move
for %%a in (AI svg eps) do (for /R %mypath% %%f in (*.%%a) do move "%%f" "%mypath%AI")
for %%a in (jpg jpeg gif tif cr2) do (for /R %mypath% %%f in (*.%%a) do move "%%f" "%mypath%IMAGES")
for %%a in (ico png) do (for /R %mypath% %%f in (*.%%a) do move "%%f" "%mypath%ICON")
for %%a in (doc docx pdf) do (for /R %mypath% %%f in (*.%%a) do move "%%f" "%mypath%DOC")
for %%a in (mp4 ts) do (for /R %mypath% %%f in (*.%%a) do move "%%f" "%mypath%VIDEO")
for %%a in (rar zip) do (for /R %mypath% %%f in (*.%%a) do move "%%f" "%mypath%RAR")
@vitqst
vitqst / asb
Last active May 14, 2016 20:44
{"status":0,"value":7,"msg":"OK","gift_id":"10","arrGift":{"1":"6","2":"2","3":"10","4":"5","5":"7","6":"3","7":"8","8":"4","9":"9","10":"1"},"nextTime":"2016\/05\/16 00:00:00","type":"buy","timesBuy":0,"typeGift":"1","totalAbalone":14,"startTime":"2016-05-15 03:35:40"}