Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
require 'english'
require 'rubocop'
ADDED_OR_MODIFIED = /A|AM|^M/.freeze
changed_files = `git status --porcelain`.split(/\n/).
select { |file_name_with_status|
file_name_with_status =~ ADDED_OR_MODIFIED
@tak1n
tak1n / Bla
Created September 23, 2014 14:53
λ bennyklotz utils → λ git master* → ruby -Ilib -Itest test/kernel_test.rb -n /xxx/
Run options: -n /xxx/ --seed 42859
# Running:
super called
E
Finished in 0.178644s, 5.5977 runs/s, 0.0000 assertions/s.
<?php
/**
* File containing the UrlAliasGenerator class.
*
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
* @version //autogentag//
*/
namespace eZ\Publish\Core\MVC\Symfony\Routing\Generator;
{% set field = content.getField('file') %}
{% set uri = 'content/download/' ~ content.contentInfo.id ~ '/' ~ field.id ~ "/file/" ~ field.value.fileName|escape( 'url' ) %}
{% set uri = path( 'ez_legacy', {'module_uri': uri} ) %}
@tak1n
tak1n / delete_sequences
Created November 13, 2014 20:52
Delete all sequences in psql
SELECT string_agg('DROP SEQUENCE ' || quote_ident(c.relname) || ';', '\n') FROM pg_class c LEFT JOIN pg_depend d ON d.refobjid = c.oid AND d.deptype <> 'i' WHERE c.relkind = 'S' AND d.refobjid IS NULL;
rubinius ➤ ./configure --prefix=~/.rubies/rbx --cxx=clang++ --cc=clang --llvm-config=/usr/lib/llvm-3.5/bin/llvm-config git:master* mri-2.1.5
Checking clang: found
Checking clang++: found
Checking bison: found
Checking for 'llvm-config': found! (version 3.5 - api: 305)
Checking sizeof(short): 2 bytes
Checking sizeof(int): 4 bytes
Checking sizeof(void*): 8 bytes
Checking sizeof(size_t): 8 bytes
@tak1n
tak1n / gist:1efaa234484d9300c2f0
Created December 30, 2014 17:43
Rubinius press
Sites which should know about rubinius 3.0 or mention it:
http://rubydaily.org/
http://rubyweekly.com/
http://www.rubyflow.com/
https://twitter.com/ruby_news
http://www.rubyinside.com/
http://www.rorcasts.com/
http://ruby5.envylabs.com/
http://www.sitepoint.com/ruby/
checking for yaml.h... no
checking for config.h... no
creating Makefile
compiling psych_to_ruby.c
compiling psych.c
compiling psych_emitter.c
compiling psych_parser.c
psych_parser.c:120:17: warning: expression result unused [-Wunused-value]
RB_GC_GUARD(src);
^~~
rubinius ➤ ./configure --prefix=/home/benny/.rubies/rbx-2.5.2 --cc=clang-3.5 --cxx=clang++-3.5 --llvm-config=/usr/lib/llvm-3.5/bin/llvm-config
Checking clang-3.5: found
Checking clang++-3.5: found
Checking for 'llvm-config': found! (version 3.5.0 - api: 305)
Checking sizeof(short): 2 bytes
Checking sizeof(int): 4 bytes
Checking sizeof(void*): 8 bytes
Checking sizeof(size_t): 8 bytes
Checking sizeof(long): 8 bytes
require 'mkmf'
have_library('socket')