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
require 'faraday' | |
require 'multi_json' | |
# set API key in `MERK_API_TOKEN` | |
MerkSource.new('cz').find_by_registration_no('28897501') | |
MerkSource.new('sk').find_by_registration_no('31398871') |
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 | |
} |
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
#!/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
# 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
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
#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
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 <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
<% 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 %> |
NewerOlder