-
Open the Terminal
-
Use
mysqldumpto backup your databases -
Check for MySQL processes with:
ps -ax | grep mysql -
Stop and kill any MySQL processes
-
Analyze MySQL on HomeBrew:
brew remove mysql
This file contains hidden or 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
| sudo -i | |
| cd | |
| apt-get install build-essential checkinstall && apt-get build-dep imagemagick -y | |
| curl -O http://www.imagemagick.org/download/ImageMagick-6.9.1-10.tar.gz | |
| tar xzvf ImageMagick-6.9.1-10.tar.gz | |
| cd ImageMagick-6.9.1-10/ | |
| ./configure --prefix=/opt/imagemagick-6.9.1-10 && make | |
| checkinstall |
This file contains hidden or 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
| 1) In your terminal, open the file using vim: | |
| vim file_name | |
| 2) Remove all BOM characters: | |
| :set nobomb | |
| 3) Save the file: | |
| :wq |
This file contains hidden or 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
| require "benchmark" | |
| n = 10000 | |
| arr = (1..1000).to_a | |
| zip = arr.zip arr | |
| hash = Hash[zip] | |
| Benchmark.bm do |x| | |
| x.report("%-30s" %["sampling array"]) { n.times do | |
| arr.sample |
This file contains hidden or 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
| require 'rubygems' | |
| require 'zip' | |
| archive_directory_path = '' | |
| archive_zip_path = '' | |
| Zip::File.open( archive_zip_path, Zip::File::CREATE ) do |zip_file| | |
| Dir[ File.join( archive_directory_path, "**", "**" ) ].each do |file| | |
| zip_file.add( file.sub( "#{ archive_directory_path }/", "" ), file ) | |
| end |
This file contains hidden or 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
| # delete local tag '12345' | |
| git tag -d 12345 | |
| # delete remote tag '12345' (eg, GitHub version too) | |
| git push origin :refs/tags/12345 | |
| # alternative approach | |
| git push --delete origin tagName | |
| git tag -d tagName |
This file contains hidden or 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
| // Available in jCanvas v20.1.0 | |
| // The pixel multiple to snap to | |
| var snapToAmount = 40; | |
| // Round the given value to the nearest multiple of n | |
| function nearest(value, n) { | |
| return Math.round(value / n) * n; | |
| } | |
| $('canvas').drawArc({ | |
| layer: true, |
This file contains hidden or 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
| h = { | |
| 'a' => :a_value, | |
| 'b' => nil, | |
| 'c' => false | |
| } | |
| h.fetch('a', :default_value) #=> :a_value | |
| h.fetch('b', :default_value) #=> nil | |
| h.fetch('c', :default_value) #=> false | |
| h.fetch('d', :default_value) #=> :default_value |
This file contains hidden or 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
| /** | |
| * Change file modification time to the date from EXIF | |
| * | |
| * System Requirements: | |
| * | |
| * > npm install -g includejs | |
| * > npm install -g exif | |
| * | |
| * Usage: | |
| * |