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
/** | |
* Implements callback_redirect_form(). | |
*/ | |
function commerce_monogram_redirect_form($form, &$form_state, $order, $payment_method) { | |
$wrapper = entity_metadata_wrapper('commerce_order', $order); | |
switch ($payment_method['method_id']) { | |
case 'monogram_tatrapay_tb': | |
break; | |
case 'monogram_eplatby_vub': |
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 'elasticsearch/model' | |
class Cbr | |
include ActiveModel::Model | |
include Elasticsearch::Model | |
index_name 'cbr' | |
document_type 'UC_CBR_003' | |
# Digital Objects per day |
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
# Store CBRFilter objects | |
# | |
class CBRFilters | |
include Enumerable | |
extend Forwardable | |
attr_accessor :filters | |
def_delegators :@filters, :each, :size, :<<, :push |
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 | |
# CentOS rbenv system wide installation script | |
# Forked from https://gist.github.com/1237417 | |
# Installs rbenv system wide on CentOS 5/6, also allows single user installs. | |
# Install pre-requirements | |
yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel \ | |
make bzip2 autoconf automake libtool bison iconv-devel git-core |
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
{ | |
"head": [ | |
{ | |
"CoType": "CoType", | |
"objects": "objects", | |
"objects_avg_quality": "objects_avg_quality" | |
} | |
], | |
"rows": [ | |
{ |
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 @records | |
posts = @records.map{|p| p.post_id} | |
posts_extra_data = Message::Post | |
.joins( | |
'LEFT JOIN "message_webs" ON "message_webs"."post_id" = "message_posts"."id"', | |
'LEFT JOIN "source_sources" ON "source_sources"."id" = "message_posts"."source_source_id"', | |
'LEFT JOIN "source_sections" ON "source_sections"."id" = "message_posts"."source_section_id"' | |
) | |
.where(id: posts) |
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
# Spustit cez []->Source | |
# | |
library(curl) | |
library(jsonlite) | |
# Zistime si meno adresara v ktorom sa nachadza subor so scriptom | |
sourceDir <- getSrcDirectory(function(dummy) {dummy}) | |
# Vlozime script s funciami pre geocoding. | |
source(paste(sourceDir, '/', 'geocoding.R', sep = '')) |
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
# Geocoding script for large list of addresses. | |
# Shane Lynn 10/10/2013 | |
#load up the ggmap library | |
library(ggmap) | |
# get the input data | |
infile <- "input" | |
data <- read.csv(paste0('c:\\Temp\\R scripts\\', infile, '.csv'), fileEncoding = "UTF-8") | |
# get the address list, and append "Ireland" to the end to increase accuracy |
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
var createSubmitForm = function(path, parameters, method = 'POST') { | |
var form = $('<form></form>'); | |
form.attr('action', path); | |
form.attr('method', method); | |
parameters.authenticity_token = $('meta[name="csrf-token"]').attr('content'); | |
for (var key in parameters) { | |
if (parameters.hasOwnProperty(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
-- Table: public.testy | |
-- DROP TABLE public.testy; | |
CREATE TABLE public.testy | |
( | |
id integer NOT NULL DEFAULT nextval('testy_id_seq'::regclass), | |
prod1 integer, | |
prod2 integer, | |
prod3 integer, |
OlderNewer