This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load application specific configuration | |
require 'ostruct' | |
AppConfig = OpenStruct.new(YAML.load_file('config/config.yml')[Rails.env]) | |
Rails::Initializer.run do |config| | |
# Sessions | |
config.action_controller.session_store = :active_record_store | |
config.action_controller.session = { | |
:session_key => AppConfig.session_key, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% if f.object.new_record? %> | |
<%= link_to_function "Smazat", "$(this).up('.line').remove(); " %> | |
<% else %> | |
<%= f.hidden_field(:_delete) %> | |
<%= link_to_function "Smazat", "$(this).previous().value = '1'; $(this).up('.line').hide(); " %> | |
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <string> | |
#include <cstdlib> | |
using namespace std; | |
int main(int argc, char* argv[]) { | |
vector<string> lines; | |
string line; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Factory | |
def self.hash(name, attributes = {}) | |
self.send("#{name}_hash").merge(attributes) | |
end | |
def self.build(name, attributes = {}) | |
Kernel.const_get(name.to_s.capitalize).new(self.hash(name, attributes)) | |
end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "dynamicarray.h" | |
using namespace std; | |
DynamicArray::DynamicArray() { | |
DynamicArray::DynamicArray(5); | |
} | |
DynamicArray::DynamicArray(int initSize) { | |
size = initSize; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cz: | |
numbers: | |
ones_male: [nula, jeden, dva, tři, čtyři, pět, šest, sedm, osm, devět] | |
ones_female: [nula, jedna, dva, tři, čtyři, pět, šest, sedm, osm, devět] | |
teens: [deset, jedenáct, dvanáct, třináct, čtrnáct, patnáct, šestnáct, sedmnáct, osmnáct, devatenáct] | |
tens: [nula, deset, dvacet, třicet, čtyřicet, padesát, šedesát, sedmdesát, osmdesát, devadesát] | |
hundreds: [nula, sto, dvěstě, třista, čtyřista, pětset, šestset, sedmset, osmset, devětset] | |
thousands: | |
one: tisíc | |
few: tisíce |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
module Trashable | |
extend ActiveSupport::Concern | |
included do | |
define_model_callbacks :trash, :only => [ :after, :before ] | |
default_scope where('trashed_at IS NULL') | |
scope :trashed, where('trashed_at IS NOT NULL') | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# add yourself before use to sudoerrs | |
# Cmnd_Alias PROXY = /usr/sbin/networksetup -setsocksfirewallproxy* | |
# your_login ALL=NOPASSWD: PROXY | |
SSH_HOST="somehostname" | |
PORT=9999 # configured in System Preferences | |
NET_SERVICE="Wi-Fi" # on MacBook Air | |
SSH_OPTS="-C2qTnNfD" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Basic Settings | |
# | |
fontName = "Monaco" | |
fontSize = 11 | |
# Extra files to include | |
# | |
myExtraIncludes = ".tm_properties,.htaccess,.gitignore" | |
fileBrowserGlob = "{*,$myExtraIncludes}" | |
include = "{$include,$myExtraIncludes}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
function dependency { | |
$2 > /dev/null 2>&1 | |
if [[ "$?" == "0" ]] ; then | |
echo "$1 installed" | |
else | |
echo "To install $1: '$3'" | |
fi | |
} |
OlderNewer