Skip to content

Instantly share code, notes, and snippets.

@arysom
arysom / vimrc
Last active May 20, 2019 07:20
and another vim vimrc, this time for mac osx, macvim
" System vimrc file for MacVim
"
" Maintainer: feel free
" Last Change: Wed 20 Feb 2019
set nocompatible
" The default for 'backspace' is very confusing to new users, so change it to a
" more sensible value. Add "set backspace&" to your ~/.vimrc to reset it.
set backspace+=indent,eol,start
@arysom
arysom / gulpfile.js
Created May 7, 2016 20:00
Gulp upload through ftp after watch
var gulp = require('gulp'),
watch = require('gulp-watch'),
gutil = require( 'gulp-util' ),
sass = require('gulp-sass'),
notify = require("gulp-notify"),
ftp = require( 'vinyl-ftp' );
gulp.task( 'deploy', ['css'], function () {
@arysom
arysom / vimrc
Last active August 1, 2016 13:26
Yet another simple and ultimate vimrc for linux gvim
" System vimrc file for MacVim
"
" Maintainer: Bjorn Winckler <[email protected]>
" Last Change: Sat Aug 29 2009
set nocompatible
" The default for 'backspace' is very confusing to new users, so change it to a
" more sensible value. Add "set backspace&" to your ~/.vimrc to reset it.
set backspace+=indent,eol,start
@arysom
arysom / shop.sql
Created October 1, 2015 13:58
codeigniter simple cart
-- phpMyAdmin SQL Dump
-- version 4.2.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Czas generowania: 01 Paź 2015, 15:57
-- Wersja serwera: 5.6.21
-- Wersja PHP: 5.6.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
@arysom
arysom / validate_phone
Last active August 29, 2015 14:17
validate PL phone number codeigniter function
function validate_phone($phone){
if(
!preg_match("/\(\d{2}\) \d{3}-\d{2}-\d{2}/",$phone) &&
!preg_match("/\d{3}-\d{3}-\d{3}/",$phone)
){
$this->form_validation->set_message('validate_phone', 'Pole {field} nie zawiera poprawnego numeru telefonu');
return false;
} else {
return true;
@arysom
arysom / links.txt
Last active August 29, 2015 14:17
some links to work with transitive closure table in php
@arysom
arysom / slideshow.pictures.js
Created October 5, 2014 19:54
uikit ajax picture upload and delete dynamically added pictures
$(function(){
var progressbar = $("#progressbar"),
bar = progressbar.find('.uk-progress-bar'),
settings = {
action: '/ajax/add_slideshow_pic', // upload url
param: 'userfile',
type: 'json',
allow : '*.(jpg|gif|png)', // allow only images
@arysom
arysom / eu_countries.sql
Created January 8, 2014 07:51
list of european countries 2013, taken from http://en.wikipedia.org/wiki/List_of_sovereign_states_and_dependent_territories_in_Europe written in sql, ready to insert
CREATE TABLE IF NOT EXISTS `countries` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=51 ;
INSERT INTO `countries` (`id`, `name`) VALUES
(1, 'Albania'),
(2, 'Andorra'),
(3, 'Armenia'),
@arysom
arysom / _vimrc
Last active December 29, 2015 02:18
gvim portable enchanced vimrc plus minor addings
set nocompatible " not compatible with the old-fashion vi mode
set bs=2 " allow backspacing over everything in insert mode
set history=50 " keep 50 lines of command line history
set ruler " show the cursor position all the time
set autoread " auto read when file is changed from outside
set nu " show line numbers
filetype on " Enable filetype detection
filetype indent on " Enable filetype-specific indenting
@arysom
arysom / codeigniter.snippets
Last active February 4, 2016 21:50
Codeigniter vim snippets. https://gist.github.com/channeleaton/864821 plus snipps for my_model, and template spark
##### CodeIgniter Snippets #####
# Generic $this->
snippet this
$this->${1:model/controller}->${2:method}(${3:array});${4}
# New Model Class
snippet classm
<?php
/*
* ${1:Describe the model's purpose}
*/