Skip to content

Instantly share code, notes, and snippets.

#include <sys/queue.h>
#include <stdlib.h>
#include <stdio.h>
struct entry {
SLIST_ENTRY(entry) next;
};
SLIST_HEAD(top, entry) head;
class User < ActiveRecord::Base
self.default_timezone = 'Moscow' # работает на запись
# ...
end
1.8.7 :002 > User.first.act_ts
=> Sat, 20 Mar 2010 07:06:25 UTC +00:00
# нельзя поменять с change
@Houdini
Houdini / gist:1917959
Created February 26, 2012 17:55
cubiс_equation.py
# encoding: utf8
import pylab, math
# Задание переменных
delta_omega_1 = 0.1
delta_omega_2 = 0.2
omega_2_omega_1 = 10.0
gamma = 2.0
# левая и правая границы графика
make: *** [pure_site_install] Error 13
BOBTFISH/Catalyst-Runtime-5.90002.tar.gz
/usr/bin/make install -- NOT OK
----
You may have to su to root to install the package
(Or you may want to run something like
o conf make_install_make_command 'sudo make'
to raise your permissions.Failed during this command:
VPIT/Variable-Magic-0.46.tar.gz : install NO
FLORA/B-Hooks-EndOfScope-0.09.tar.gz : install NO
@Houdini
Houdini / gist:1192015
Created September 4, 2011 00:32
brew easy-tag install problem
houdini: ~/Music > brew install easy-tag
==> Installing easy-tag dependency: libiconv
==> Downloading http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
######################################################################## 100.0%
==> Downloading patches
######################################################################## 100.0%
######################################################################## 100.0%
==> Patching
patching file Makefile.devel
Hunk #1 succeeded at 106 (offset 1 line).
activesupport (3.0.7) lib/active_support/whiny_nil.rb:48:in `method_missing'
haml (3.1.1) lib/haml/parser.rb:397:in `close'
haml (3.1.1) lib/haml/parser.rb:171:in `process_indent'
haml (3.1.1) lib/haml/parser.rb:171:in `times'
haml (3.1.1) lib/haml/parser.rb:171:in `process_indent'
haml (3.1.1) lib/haml/parser.rb:137:in `parse'
haml (3.1.1) lib/haml/engine.rb:124:in `initialize'
haml (3.1.1) lib/haml/template/plugin.rb:34:in `new'
haml (3.1.1) lib/haml/template/plugin.rb:34:in `compile'
haml (3.1.1) lib/haml/template/plugin.rb:39:in `call'
@Houdini
Houdini / gist:995276
Created May 27, 2011 13:43
rake spec
host192-168-1-3:dm-rails houdini$ rake spec
/Users/houdini/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': no such file to load -- dm--adapter/spec/setup (LoadError)
from /Users/houdini/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/houdini/.rvm/gems/ruby-1.9.2-p180/gems/dm-core-1.1.0/lib/dm-core/spec/setup.rb:49:in `require_spec_adapter'
from /Users/houdini/.rvm/gems/ruby-1.9.2-p180/gems/dm-core-1.1.0/lib/dm-core/spec/setup.rb:28:in `configure'
from /Users/houdini/.rvm/gems/ruby-1.9.2-p180/gems/dm-core-1.1.0/lib/dm-core/spec/setup.rb:69:in `perform_action'
from /Users/houdini/.rvm/gems/ruby-1.9.2-p180/gems/dm-core-1.1.0/lib/dm-core/spec/setup.rb:19:in `setup'
from /Users/houdini/fun-box/dm-rails/spec/spec_helper.rb:7:in `<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in `require'
from <internal:lib/rubygems/custom_require>:29:in `require'
set :config_yaml, YAML.load_file(File.dirname(__FILE__) + '/deploy_config.yml')
set :stages, ['production', 'staging']
set :default_stage, 'staging'
require 'capistrano/ext/multistage'
# set :whenever_command, "bundle exec whenever"
# set(:whenever_update_flags) {"--set environment=#{stage} --update-crontab #{whenever_identifier}"}
# require 'whenever/capistrano'
@Houdini
Houdini / mysql_install_db: segmentation fault: 11
Created April 25, 2011 20:10
mysql_install_db --force --basedir=/usr/local/Cellar/mysql/5.5.10 --datadir=/usr/local/Cellar/mysql/5.5.10/data/ --tmpdir=/tmp
~ $ mysql_install_db --force --basedir=/usr/local/Cellar/mysql/5.5.10 --datadir=/usr/local/Cellar/mysql/5.5.10/data/ --tmpdir=/tmp
mkdir: /usr/local/Cellar/mysql/5.5.10/data//mysql: Permission denied
chmod: /usr/local/Cellar/mysql/5.5.10/data//mysql: Permission denied
mkdir: /usr/local/Cellar/mysql/5.5.10/data//test: Permission denied
chmod: /usr/local/Cellar/mysql/5.5.10/data//test: Permission denied
Installing MySQL system tables...
/usr/local/bin/mysql_install_db: line 428: 5078 Done { echo "use mysql;"; cat $create_system_tables $fill_system_tables; }
5079 Done(141) | eval "$filter_cmd_line"
5080 Segmentation fault: 11 | $mysqld_install_cmd_line > /dev/null
@Houdini
Houdini / brew info mysql
Created April 22, 2011 01:37
same segmentation error
Last login: Fri Apr 22 05:11:36 on console
~ $ brew info mysql
mysql 5.5.10
http://dev.mysql.com/doc/refman/5.5/en/
Depends on: cmake, readline, pidof
find: /usr/local/Cellar/mysql/5.5.10/data: Permission denied
du: /usr/local/Cellar/mysql/5.5.10/data: Permission denied
/usr/local/Cellar/mysql/5.5.10 (6232 files, 219M)