-
Install XQuartz
-
Install meld with brew
brew install meld
-
Copy PYTHONPATH
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
<?php | |
/** | |
* Create a web friendly URL slug from a string. | |
* | |
* Although supported, transliteration is discouraged because | |
* 1) most web browsers support UTF-8 characters in URLs | |
* 2) transliteration causes a loss of information | |
* | |
* @author Sean Murphy <[email protected]> | |
* @copyright Copyright 2012 Sean Murphy. All rights reserved. |
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
# -*- encoding: utf-8 -*- | |
import re | |
def convert_bold(content): | |
raw = bytearray(content) | |
for m in re.finditer(r"\'\'((?!\'\').)+\'\'", content): | |
start = m.start() | |
end = m.end() |
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
# Check the output file | |
if ARGV[1].nil? | |
print 'Insert the name of your output file (tsv file) ' | |
outname = $stdin.gets.chomp | |
else | |
outname = ARGV[1] | |
end | |
# Deserialize | |
require 'yaml' | |
survey = YAML.load(File.read(ARGV[0])) |
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
#http://blog.wyeworks.com/2009/7/13/paperclip-file-rename | |
Paperclip.interpolates :default_image_type do |attachment, style| | |
attachment.instance.get_user_default_profile_image | |
end | |
Paperclip.interpolates :normalized_avatar_file_name do |attachment, style| | |
attachment.instance.normalized_avatar_file_name | |
end | |
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
I get the same error message when I run docker. | |
It is solved by adding myself to the user group 'docker' | |
Try to run the following command to add yourself to the group | |
usermod -aG docker ${USER} | |
Or you can run the following command to find out what groups you belong to | |
groups $USER | |
https://github.com/docker/compose/issues/1214 |
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
Black 0;30 Dark Gray 1;30 | |
Red 0;31 Light Red 1;31 | |
Green 0;32 Light Green 1;32 | |
Brown/Orange 0;33 Yellow 1;33 | |
Blue 0;34 Light Blue 1;34 | |
Purple 0;35 Light Purple 1;35 | |
Cyan 0;36 Light Cyan 1;36 | |
Light Gray 0;37 White 1;37 | |
========= |
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
# activerecord-3.0.0/lib/active_record/connection_adapters/mysql_adapter.rb | |
# Maps logical Rails types to MySQL-specific data types. | |
def type_to_sql(type, limit = nil, precision = nil, scale = nil) | |
return super unless type.to_s == 'integer' | |
case limit | |
when 1; 'tinyint' | |
when 2; 'smallint' | |
when 3; 'mediumint' | |
when nil, 4, 11; 'int(11)' # compatibility with MySQL default |
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
/* | |
Assuming you have an enum type like this. | |
You want to rename 'pending' to 'lodged' | |
*/ | |
CREATE TYPE dispute_status AS ENUM('pending', 'resolved', 'open', 'cancelled'); | |
BEGIN; | |
ALTER TYPE dispute_status ADD VALUE 'lodged'; | |
UPDATE dispute SET status = 'lodged' WHERE status = 'pending'; |
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
# Unregister repo | |
sudo rm -fv /etc/yum.repos.d/nodesource* | |
# Clear cache | |
sudo yum clean all | |
sudo rm -rf /var/cache/yum | |
# Add new repo | |
curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash - |