Skip to content

Instantly share code, notes, and snippets.

View yumitsu's full-sized avatar
🐢
I LIEK TURTLES

Alex Zinchenko yumitsu

🐢
I LIEK TURTLES
  • St. Petersburg, Russia
View GitHub Profile
@yumitsu
yumitsu / disable-werror.patch
Last active December 14, 2015 02:39
Patch to compile ruby 1.9.3 with Clang on Mac OSX 10.8 (https://bugs.ruby-lang.org/issues/7830)
diff --git a/configure.in b/configure.in
index 732dd5d..8f5b364 100644
--- a/configure.in
+++ b/configure.in
@@ -172,6 +172,7 @@ RUBY_PROGRAM_VERSION=`sed -n 's/^#define RUBY_VERSION "\(.*\)"/\1/p' $srcdir/ver
AC_SUBST(RUBY_PROGRAM_VERSION)
RUBY_RELEASE_DATE=`sed -n 's/^#define RUBY_RELEASE_DATE "\(.*\)"/\1/p' $srcdir/version.h`
AC_SUBST(RUBY_RELEASE_DATE)
+RUBY_PATCHLEVEL=`sed -n 's/^#define RUBY_PATCHLEVEL //p' $srcdir/version.h`
AC_DEFINE(CANONICALIZATION_FOR_MATHN)
window.namespace = ->
args = arguments[0]
target = global || window
loop
for subpackage, obj of args
target = target[subpackage] or= {}
args = obj
break unless typeof args is 'object'
Class = args
@yumitsu
yumitsu / gist:3782934
Created September 25, 2012 16:24
jQuery scroller, like bootstrap scrollspy
$(document).ready(function(){
var lastId, topMenu = $("#navbar-scroll"),
topMenuHeight = topMenu.outerHeight() + 150,
menuItems = topMenu.find("a"),
scrollItems = menuItems.map(function() {
var item = $($(this).attr("href"));
if (item.length) {
return item;
}
});
@yumitsu
yumitsu / wait_until.rb
Created March 24, 2012 06:45 — forked from metaskills/wait_until.rb
Never sleep() using Capybara!
# Have you ever had to sleep() in Capybara-WebKit to wait for AJAX and/or CSS animations?
describe 'Modal' do
should 'display login errors' do
visit root_path
click_link 'My HomeMarks'
within '#login_area' do
fill_in 'email', with: 'will@not.work'
fill_in 'password', with: 'test'
@yumitsu
yumitsu / rspec_cheat_sheet.rd
Created March 24, 2012 05:16 — forked from byplayer/rspec_cheat_sheet.rd
rspec cheat sheet
INSTALL
=======
$ gem install rspec
RSPEC-RAILS
===========
RAILS-3
=======
@yumitsu
yumitsu / gist:2000124
Created March 8, 2012 10:13
Rake::CLI in JavaScript
var Namespace, Namespaces, Task, namespace, task;
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
Namespaces = {
names: [],
descriptions: [],
tasks: [],
injectMethods: function(ins) {
var nspaces;
nspaces = this;
ins.fqn = function() {
@yumitsu
yumitsu / gist:2000140
Created March 8, 2012 10:15
Rake::CLI in CoffeeScript
Namespaces =
names: []
descriptions: []
tasks: []
injectMethods: (ins) ->
nspaces = @
ins.fqn = ->
@_nameChain().join ':'
var testObj = {
_version: '0.1',
setVersion: function(ver) {
this._version = ver;
return this;
},
getVersion: function() {
return this._version;
125a126,131
>
> hidden.bind('uploadcare-success', function() {
> UploadCare.FileData.fetch(hidden.val(), function(data) {
> UploadCare.Line.showFileData(data);
> });
> });
206a213,229
> },
>
# -*- encoding: utf-8 -*-
$KCODE = 'u'
require 'i18n'
######
# I18n.i('мир', 'рд') => "мира"
# i('мир', 'рд') => "мира"
if I18n.locale == :ru