This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Backuping a single table from a database | |
mysqldump -u -p database_one -h host table_name > /var/www/backups/table_name.sql | |
Backuping a single table from a database with query | |
mysqldump -u #{user} -p#{pass} -h #{server} -nt --databases #{database} --tables #{table} --where="#{query}" > example.sql | |
mysqldump -u root -prootpass -h ssserver -nt --databases example_development --tables products --where="id > 7970001" > products.sql | |
-n -t for --no-create-db --no-create-info | |
mysqldump -u root -pmagrathea -h ssserver --no-create-db --no-create-info --databases marvin_real3 --tables products --where="id > 7970001" > pr2.sql | |
Restoring the table into another database |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Verifying my Blockstack ID is secured with the address 1N4JtW2rHFdMR3QeuCSUvif4aWcHCRt5DR https://explorer.blockstack.org/address/1N4JtW2rHFdMR3QeuCSUvif4aWcHCRt5DR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* $Id: mxSwimlaneLayout.js,v 1.3 2013/09/23 14:11:22 david Exp $ | |
* Copyright (c) 2005-2012, JGraph Ltd | |
*/ | |
/** | |
* Class: mxSwimlaneLayout | |
* | |
* A hierarchical layout algorithm. | |
* | |
* Constructor: mxSwimlaneLayout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# download html | |
wget \ | |
--recursive \ | |
--no-clobber \ | |
--page-requisites \ | |
--html-extension \ | |
--convert-links \ | |
--no-parent \ | |
--restrict-file-names=nocontrol \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get the pages | |
wget \ | |
--recursive \ | |
--no-clobber \ | |
--page-requisites \ | |
--html-extension \ | |
--convert-links \ | |
--no-parent \ | |
--restrict-file-names=nocontrol \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# Create display override file to force Mac OS X to use RGB mode for Display | |
# see http://embdev.net/topic/284710 | |
# | |
# Update 2013-06-24: added -w0 option to prevent truncated lines | |
require 'base64' | |
data=`ioreg -l -w0 -d0 -r -c AppleDisplay` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*global define*/ | |
'use strict'; | |
define(function () { | |
var map = { | |
'ά': 'A', | |
'Ά': 'Α', | |
'έ': 'Ε', | |
'Έ': 'Ε', | |
'ή': 'Η', | |
'Ή': 'Η', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Flexible buttons with ems (duh!) | |
*/ | |
body { | |
font-family: sans-serif | |
} | |
button { | |
padding: .5em .8em .4em; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git push --force | |
Counting objects: 375, done. | |
Delta compression using up to 2 threads. | |
Compressing objects: 100% (274/274), done. | |
Writing objects: 100% (277/277), 47.32 KiB, done. | |
Total 277 (delta 199), reused 0 (delta 0) | |
remote: Traceback (most recent call last): | |
remote: File "/opt/python/domains/bitbucket.org/current/bitbucket/scripts/git/hooks/pre-receive", line 29, in <module> | |
remote: from bitbucket.apps.repo2.hooks import prehooks | |
remote: File "/opt/python/domains/bitbucket.org/current/bitbucket/apps/repo2/hooks.py", line 16, in <module> |
NewerOlder