Skip to content

Instantly share code, notes, and snippets.

View ababushkin's full-sized avatar

Anton Babushkin ababushkin

View GitHub Profile
@ababushkin
ababushkin / js-snippets-squiz-matrix.js
Created September 21, 2011 23:26
JavaScript Snippets for Squiz / MySource Matrix
/**
/**
* Changes the sort order of assets in Squiz Matrix
* Author: Nicholas Hubbard (http://www.zedsaid.com/blog/change-the-asset-map-sort-order-using-javascript-in-squiz-matrix)
*
* @param number id ID of the asset to move
* @param number parent ID of the parent that the asset is under
* @param number new_position New position of asset (0 is first in the sort order)
*
* @return string
@ababushkin
ababushkin / gist:1221305
Created September 16, 2011 05:54 — forked from benjaminpearson/gist:1102194
Apps for a fresh Mac OS
1password - Password mangager
Adium - Instant messenger
Arq - Amazon s3 backup
Base - Sqlite db viewer
Caffeine - Keeps computer awake
Charles - Web debugging proxy
Cornerstone - SVN client
Cyberduck - FTP client
Delibar - Delicious bookmarking menu item
DiskWave - Monitor hdd space
@benjaminpearson
benjaminpearson / gist:1102194
Last active March 5, 2016 15:50
Apps for a fresh Mac OS
1password - Password mangager
3hub - Amazon s3 file manager
Adium - Instant messenger
Arq - Amazon s3 backup
Air Server - Send your iPhone/iPad screen to your mac screen for demos
Alfred - Launch bar app (must have)
Base - Sqlite db viewer
Caffeine - Keeps computer awake
Charles - Web debugging proxy
Cornerstone - SVN client
@stream7
stream7 / migration_integer_limit_option
Created July 7, 2011 14:09
Rails migrations integer :limit option
literally always have to look up the meaning of :limit in migrations when it comes to integer values. Here's an overview. Now let's memorise it (oh, this works for MySQL, other databases may work differently):
:limit Numeric Type Column Size Max value
1 tinyint 1 byte 127
2 smallint 2 bytes 32767
3 mediumint 3 byte 8388607
nil, 4, 11 int(11) 4 byte 2147483647
5..8 bigint 8 byte 9223372036854775807
Note: by default MySQL uses signed integers and Rails has no way (that I know of) to change this behaviour. Subsequently, the max. values noted are for signed integers.
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Created: 2010/12/05
// Updated: 2018/09/12
// License: MIT
//
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it)
//