Starting from:
lein new foo
cd foo
Say I have a random JAR file that is not available in any repository:
touch README.md
This benchmark has been misleading for a while. It was originally made to demonstrate how JIT compilers can do all sorts of crazy stuff to your code - especially LuaJIT - and was meant to be a starting point of discussion about what exactly LuaJIT does and how.
As a result, its not indicative of what its performance may be on more realistic data. Differences can be expected because
| Latency Comparison Numbers (~2012) | |
| ---------------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
| logger () | |
| { | |
| time=`TZ="Asia/Shanghai" date +"%Y-%m-%d %T"`; | |
| echo "[$time] $*" | |
| } | |
| rm () | |
| { | |
| local limit=50; | |
| if [ -d $HOME/.local/share/Trash/files ]; then |
This gist is no longer valid. Please see Compass-Rails for instructions on how to install.
| class AvatarUploader < CarrierWave::Uploader::Base | |
| include CarrierWave::MiniMagick | |
| def extension_white_list | |
| model.skip_avatar_extension_check ? nil : %w(jpg jpeg gif png bmp) | |
| end | |
| end |
| #!/bin/bash -e | |
| # | |
| # Since unicorn creates a new pid on restart/reload, it needs a little extra love to | |
| # manage with runit. Instead of managing unicorn directly, we simply trap signal calls | |
| # to the service and redirect them to unicorn directly. | |
| # | |
| # To make this work properly with RVM, you should create a wrapper for the app's gemset unicorn. | |
| # | |
| function is_unicorn_alive { |
| # NOTE: | |
| # This version is out-of-date. | |
| # Please access http://github.com/maraigue/devnull for the versions under development. | |
| # Ruby implementation of null file (like /dev/null on Un*x, NUL on Windows) | |
| # (C) 2010- H.Hiro(Maraigue) main@hhiro.net | |
| # | |
| # DevNull works like an IO object. For example: | |
| # dn = DevNull.new | |
| # dn.puts "foo" # => nil (do nothing) |
| # WPF Clock in IronRuby! | |
| # <t-edmor@microsoft.com> | |
| require 'WindowsBase' | |
| require 'PresentationFramework' | |
| require 'PresentationCore' | |
| require 'System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' | |
| class Clock |
| "Memcached cache backend" | |
| from django.core.cache.backends import memcached | |
| from django.utils.encoding import smart_unicode, smart_str | |
| MIN_COMPRESS_LEN = 150000 | |
| class CacheClass(memcached.CacheClass): | |
| def add(self, key, value, timeout=None, min_compress_len=MIN_COMPRESS_LEN): | |
| if isinstance(value, unicode): |