Skip to content

Instantly share code, notes, and snippets.

View schovi's full-sized avatar
👁️

David Schovanec schovi

👁️
View GitHub Profile
@schovi
schovi / curl.example
Created September 14, 2012 17:58
How to use httpie instal of curl with elasticsearch
$ curl -XPUT 'http://localhost:9200/twitter/' -d '{
index : {
number_of_shards : 3
number_of_replicas : 2
}
}'
module PostgresEnum
class MissingEnumError < ActiveRecord::ActiveRecordError
end
class MethodDefinedError < ActiveRecord::ActiveRecordError
end
extend ActiveSupport::Concern
class_methods do
@schovi
schovi / nginx.conf
Last active September 19, 2018 16:01
Simple personal ssh tunnel configuration. Require to have own domain and server with nginx.
user nobody nogroup;
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
#default_type application/octet-stream;
type SupermodelGsAdditionalProductClassificationDetails {
additionalProductClassificationCode: SupermodelGsPropertiesAdditionalProductClassificationCode
additionalProductClassificationValue: SupermodelGsPropertiesAdditionalProductClassificationValue
additionalProductClassificationCodeDescription: SupermodelGsPropertiesAdditionalProductClassificationCodeDescription
}
type SupermodelGsAdditiveDetails {
additiveLevelOfContainment: SupermodelGsPropertiesAdditiveLevelOfContainment
additiveName: SupermodelGsPropertiesAdditiveName
}
type SupermodelSchemaorgReference {
executableLibraryName: SupermodelSchemaorgPropertiesExecutableLibraryName
assemblyVersion: SupermodelSchemaorgPropertiesAssemblyVersion
programmingModel: SupermodelSchemaorgPropertiesProgrammingModel
assembly: SupermodelSchemaorgPropertiesAssembly
targetPlatform: SupermodelSchemaorgPropertiesTargetPlatform
}
scalar SupermodelSchemaorgAboutPage
@schovi
schovi / Dockerfile
Last active February 27, 2018 11:43
FROM debian:jessie
WORKDIR /cpuminer
RUN apt-get update && \
apt-get install -y build-essential libssl-dev libcurl4-openssl-dev wget tar \
libjansson-dev libgmp-dev automake screen ca-certificates
RUN wget https://github.com/JayDDee/cpuminer-opt/archive/v3.7.10.tar.gz
RUN tar xvzf v3.7.10.tar.gz -C /cpuminer --strip-components=1
// file auth0_store.js
const Auth0Store = types.model('Auth0Store', {
authenticating: true,
profile: types.maybe(types.map({...}))
}).actions(self => {
return {
authenticated() {self.authenticating = false}
}
})
{
"id": uuid(),
"revisionNumber": 99,
"updated": "2014-01-20T05:15:31.000+0000",
"created": "2013-10-27T05:08:26.000+0000",
"description": "vel accumsan tellus nisi eu orci mauris lacinia sapien quis libero nullam sit amet turpis elementum ligula vehicula consequat",
"robotsPolicy": "erat volutpat in",
"name": "ipsum aliquam non",
"qpsLimitOverall": 39,
"crossdomainPolicy": "nisl aenean lectus",
@schovi
schovi / exclude_persisting_attributes_concern.rb
Created September 29, 2017 19:35
Prevent Rails ActiveRecord from store some attributes
module ExcludePersistingAttributesConcern
module Prepender
def arel_attributes_with_values(attribute_names)
super(attribute_names_without_one_for_persisting(attribute_names))
end
end
extend ActiveSupport::Concern
included do
@schovi
schovi / Docker.md
Created April 21, 2017 21:57
Docker crashcourse - Prague Ruby Meetup 20.4.2017

Docker rychlokurz

  • David Schovanec
  • Prague Ruby Meetup 20.4.2017

Co je Docker?

  • virtualizace
  • minimální vrstva