Skip to content

Instantly share code, notes, and snippets.

View glebtv's full-sized avatar

Gleb glebtv

View GitHub Profile
@glebtv
glebtv / active_admin.css.sass
Created February 7, 2013 10:01
Active Admin CKeditor 4 hack
@import "active_admin/mixins"
@import "active_admin/components/links"
body
@include global-reset
@import "active_admin/typography"
@import "active_admin/header"
@import "active_admin/forms"
@import "active_admin/components/comments"
@import "active_admin/components/flash_messages"
@glebtv
glebtv / worklog.rb
Created June 1, 2013 09:57
worklog from git
#!/usr/bin/env ruby
require 'date'
data = `git log --shortstat --no-merges`
logs = data.split("commit ")
class Hash
def self.recursive
new { |hash, key| hash[key] = recursive }
require 'rubygems'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __FILE__)
require 'bundler/setup'
require 'zlib'
require 'ox'
class Parser < ::Ox::Sax
end
test.rb:15: [BUG] Segmentation fault
ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0005 p:---- s:0018 e:000017 CFUNC :sax_parse
c:0004 p:0030 s:0013 e:000012 BLOCK test.rb:15 [FINISH]
c:0003 p:---- s:0009 e:000008 CFUNC :open
c:0002 p:0113 s:0005 E:0017f0 EVAL test.rb:13 [FINISH]
c:0001 p:0000 s:0002 E:0020d8 TOP [FINISH]
> bundle show ox
/home/gleb/.rvm/gems/ruby-2.0.0-p195@ml/gems/ox-2.0.2
> uname -a
Linux ws.gleb.tv 3.9.5-1-ARCH #1 SMP PREEMPT Sat Jun 8 09:22:45 CEST 2013 x86_64 GNU/Linux
> gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.1/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /build/gcc/src/gcc-4.8.1/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --enable-gnu-unique-object --enable-linker-build-id --enable-cloog-backend=isl --disable-cloog-version-check --enable-lto --enable-gold --enable-ld=default --enable-plugin --with-plugin-ld=ld.gold --with-linker-hash-style=gnu --disable-install-libiberty --disable-multilib --disable-l
@glebtv
glebtv / gt
Created July 29, 2013 19:00
git commit all /usr/bin/gt
#!/usr/bin/bash
git add --all .
git commit -a
git push
@glebtv
glebtv / ml
Created August 5, 2013 04:13
app init script
#!/bin/sh
#
# init.d script for single unicorn installation.
#
# This configures a unicorn master for your app at RAILS_ROOT running in
# production mode. It will read config/unicorn.rb for further set up.
#
# You should ensure different ports or sockets are set in each config/unicorn.rb if
# you are running more than one master concurrently.
#
# Sane scrolling
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
set -g mode-mouse on
set -g mouse-resize-pane on
set -g mouse-select-pane on
set -g mouse-select-window on
# Toggle mouse on with ^B m
bind m \
#!/usr/bin/ruby
Dir.chdir(ARGV[0])
cmd = "ack --css '#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})\\b' #{ARGV[0]}"
$stderr.puts cmd
resp = `#{cmd}`
resp.gsub! /#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})\b/, '<span style="background-color: #\1\2;">#\1\2</span>'
puts '<html><pre>' + resp + '</pre></html>'
#! jQuery Ajax Queue - v0.1.2pre - 2013-03-19
#* https://github.com/gnarf37/jquery-ajaxQueue
#* Copyright (c) 2013 Corey Frang; Licensed MIT
(($) ->
# jQuery on an empty object, we are going to use this as our Queue
ajaxQueue = $({})
$.ajaxQueue = (ajaxOpts) ->
# run the actual query