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
--------------------------------------------- | |
ChunkyPNG (0.10.2) decoding benchmark (n=20) | |
--------------------------------------------- | |
ChunkyPNG OilyPNG | |
PNG - no filtering ( 1.056832) ( 0.078345) | |
PNG - UP filtering ( 3.327986) ( 0.078387) | |
PNG - PAETH filtering ( 7.499367) ( 0.089143) | |
From RGBA pixelstream ( 0.032571) ( 0.035790) |
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/env ruby | |
# Converts an InnoDB database that uses a shared InnoDB tablespace file (e.g. ibdata1) to use | |
# a separate file per table. | |
# | |
# - First change your my.cnf file to use separate files by adding "innodb_file_per_table" to | |
# the [mysqld] section. (This is safe: MySQL will revert to the giant file if it cannot find | |
# the per table file.) | |
# - Restart the MySQL server | |
# - cd to the directory of your database (cd /opt/mysql/data/mydb) |
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
crypto = require 'crypto' | |
MessageVerifier = | |
serializer: JSON.stringify | |
deserializer: JSON.parse | |
generate: (data, secret, algorithm) -> | |
algorithm ?= 'sha1' | |
base64 = (new Buffer(MessageVerifier.serializer(data))).toString('base64') |
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
1Using worker: ruby3.worker.travis-ci.org:ruby-3 | |
2 | |
3 | |
4 | |
5 | |
6I'm sorry but an error occured within Travis while running your build. | |
7 | |
8We are continuosly working on test run stability, please email support@travis-ci.org if this error persists. | |
9 | |
10Below is the stacktrace of the error: |
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
require 'chunky_png' | |
filename = 'image.png' | |
img = ChunkyPNG::Datastream.from_file(filename) | |
# The header chunk contains the information you are looking for | |
p img.header_chunk | |
# => #<ChunkyPNG::Chunk::Header:0x007fb3858a50f8 @type="IHDR", @width=8, @height=8, @depth=8, @color=3, @compression=0, @filtering=0, @interlace=1> | |
puts img.header_chunk.depth # bit depth per color channel, e.g. 8 (i.e. 24 bits for RGB, 32 bits for RGBA) |
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
require 'yaml' | |
data = YAML.load(`system_profiler SPHardwareDataType SPDisplaysDataType`) | |
puts "Computer serial number: " + data['Hardware']['Hardware Overview']['Serial Number (system)'] | |
data['Graphics/Displays'].each do |video_card, properties| | |
if properties['Displays'] | |
properties['Displays'].each do |display_name, properties| | |
puts "#{display_name}: #{properties['Display Serial Number']}" if display_name =~ /Cinema/ |
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
#!/bin/sh | |
# Modify the source and target variables, and run: | |
# $./transfer table_name | |
# Note that this will only run on the same machine as the target MySQL server machine. | |
SOURCE_MYSQL_HOST= | |
SOURCE_MYSQL_PORT= | |
SOURCE_MYSQL_USERNAME= |
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
$ bundle install | |
[ ... ] | |
Your bundle is complete! It was installed into /Users/willem/.rvm/gems/ruby-1.9.2-p0 | |
$ rails s | |
/Users/willem/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/rubygems.rb:238:in `activate': can't activate i18n (~> 0.4.1, runtime) for ["mail-2.2.10", "actionmailer-3.0.3", "rails-3.0.3"], already activated i18n-0.5.0 for ["activemodel-3.0.3", "actionpack-3.0.3", "rails-3.0.3"] (Gem::LoadError) | |
from /Users/willem/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/rubygems.rb:254:in `block in activate' | |
from /Users/willem/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/rubygems.rb:253:in `each' | |
from /Users/willem/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/rubygems.rb:253:in `activate' |
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
--------------------------------------------- | |
ChunkyPNG (0.10.0) encoding benchmark (n=10) | |
--------------------------------------------- | |
Autodetect (indexed) 0.860000 0.000000 0.860000 ( 0.856220) | |
:no_compression 0.490000 0.000000 0.490000 ( 0.488724) | |
:fast_rgba 0.140000 0.000000 0.140000 ( 0.143066) | |
:fast_rgb 0.140000 0.000000 0.140000 ( 0.143170) | |
:good_compression 0.470000 0.010000 0.480000 ( 0.476883) | |
:best_compression 1.880000 0.000000 1.880000 ( 1.877189) |
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
~ $ request-log-analyzer production.log # Analyze production.log | |
--format custom_file_format.rb # Use custom file format | |
--reject account_type free # Ignore requests from free accounts | |
--select locale en-US # Only look at en-US locale requests | |
--output HTML --file report.html # Generate an HTML report as report.html |
NewerOlder