Skip to content

Instantly share code, notes, and snippets.


Alex Fedorov waterlink

View GitHub Profile
View proc_func_problemA.pas
{есть алгоритм:}
N = 20;
n, i, j: integer;
a: array[1..N][1..N] of integer;
s: longint;
waterlink / 1793.cpp
Created Aug 19, 2011
timus Tarelki-2 1793rd problem
View 1793.cpp
#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <cstdlib>
#include <ctime>
using namespace std;
double pi = acos(-1.);
waterlink / 1748_3.cpp
Created Aug 20, 2011
timus Samoe-Slozhnoe-Chislo 1748 problem 0_o precalca
View 1748_3.cpp
#include <cstdio>
//#include "out.txt"
long long H1[] = {
View link for ath9k htc driver ubuntu lucid
View gist:5925542
RAILS_ENV=production rake db:setup
# produces the error's a no-worky
psql:/yourprojectpath/yourproject/db/structure.sql:29: ERROR: could not open extension control file "/usr/share/postgresql/9.1/extension/hstore.control": No such file or directory
# hstore postgresql extension needs to be installed, so....
sudo apt-get install postgresql-contrib
# now your extension should be available to enable so log in with psql
psql -d yourproject_production -U yourdbuser -W
View rails_tip_1.rb
# Tip 1
# Problem: Models are not loaded in migrations when config.threadsafe! is set
# Why: The threadsafe option in production doesn't load the dependencies
# Solution: Configure it to load dependencies with this option in your production.rb just after config.threadsafe!
# config/environments/production.rb
config.dependency_loading = true
waterlink / Ruby.sublime-settings
Last active Dec 19, 2015
My ruby sublime text 3 settings
View Ruby.sublime-settings
"font_size": 7.1,
"rulers": [79, 105],
"spell_check": true,
"tab_size": 2,
"translate_tabs_to_spaces": true,
"highlight_line": true,
"line_padding_top": -1,
"line_padding_bottom": -2,
"indent_guide_options": ["draw_active"],
waterlink /
Created Aug 12, 2013
Rails development tricks
# ~/.zshrc or ~/.bashrc

# allows you to remigrate your database to state of just changed or merged branch
alias nuke="rake db:drop db:create db:migrate db:test:prepare setup_sample_data"
View snippet.cpp
// snippet
// includes
#include <cstdio>
#include <string>
#include <algorithm>
#include <cmath>
#include <map>
#include <cstring>
#include <iostream>