Skip to content

Instantly share code, notes, and snippets.

Avatar
👁️

David Schovanec schovi

👁️
View GitHub Profile
View gist:234c1613c2c539c430945e1a95c7da5c
6919598227838199913855119231126554696792992136695118448313191841922775524417825151216891429923213541
9837948917619787189935571922197132977185355128371858691255934311214863828372926993213996998139912118
9712819911516295249274925911896922213911165843181262181868447395254293349493421938929117229988638933
2476951876931175825312533142569137931721739713725799446851119715122115753938166842994429692731365577
3691396937919199853599315812613951281125263711868971256541511653441136543245312424117567151668999674
9294972854229491498411271321351998983919929272128753711198282397882539157287554149474186951291188213
1135428214811459993621216218435832221856114139399136248687314682119118892393618575918692412341569411
2929921158912711182518311271272489732271565129299979967487113812154971756485549913921162939114391994
5735115881479239217981525718898929221191614222551693914913779439617933359521941311111857328992347824
1324749414111313198724813856727141934339899617632138746132396173529281922347716643138211113979119317
View pluck_in_batches.rb
module PluckInBatches
extend ActiveSupport::Concern
ID_COLUMN = "id"
class_methods do
def pluck_each(*columns, batch: 1000, limit: _pluck_each_scope_limit, &block)
raise "Block must be provided" unless block
columns = columns.flatten.map(&:to_s)
@schovi
schovi / .phoenix.js
Last active Feb 2, 2020
Phoenix configuration similar to Magnet app https://github.com/kasper/phoenix (WIP, missing some keybinds implementation)
View .phoenix.js
// Preferences
Phoenix.set({
daemon: true,
openAtLogin: true,
});
const COMMAND = 'command'
const CONTROL = 'control'
const OPTION = 'option'
const SHIFT = 'shift'
@schovi
schovi / brightness.js
Last active Feb 17, 2019
Small scripts to boost twitch volume beyond 100% or change brightness of video
View brightness.js
// To use this, open console (developer tools), change the brigtness you want, paste it there and run
// 1 = 100% ...
twitchBrightness(1.2)
function twitchBrightness(amount) {
const video = document.querySelector('video')
video.style.filter = `brightness(${amount * 100}%)`
}
View postgres_enum.rb
module PostgresEnum
class MissingEnumError < ActiveRecord::ActiveRecordError
end
class MethodDefinedError < ActiveRecord::ActiveRecordError
end
extend ActiveSupport::Concern
class_methods do
@schovi
schovi / nginx.conf
Last active Sep 19, 2018
Simple personal ssh tunnel configuration. Require to have own domain and server with nginx.
View nginx.conf
user nobody nogroup;
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
#default_type application/octet-stream;
View gs1.gql
type SupermodelGsAdditionalProductClassificationDetails {
additionalProductClassificationCode: SupermodelGsPropertiesAdditionalProductClassificationCode
additionalProductClassificationValue: SupermodelGsPropertiesAdditionalProductClassificationValue
additionalProductClassificationCodeDescription: SupermodelGsPropertiesAdditionalProductClassificationCodeDescription
}
type SupermodelGsAdditiveDetails {
additiveLevelOfContainment: SupermodelGsPropertiesAdditiveLevelOfContainment
additiveName: SupermodelGsPropertiesAdditiveName
}
View schemaorg.gql
type SupermodelSchemaorgReference {
executableLibraryName: SupermodelSchemaorgPropertiesExecutableLibraryName
assemblyVersion: SupermodelSchemaorgPropertiesAssemblyVersion
programmingModel: SupermodelSchemaorgPropertiesProgrammingModel
assembly: SupermodelSchemaorgPropertiesAssembly
targetPlatform: SupermodelSchemaorgPropertiesTargetPlatform
}
scalar SupermodelSchemaorgAboutPage
View Dockerfile
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
View MST.js
// file auth0_store.js
const Auth0Store = types.model('Auth0Store', {
authenticating: true,
profile: types.maybe(types.map({...}))
}).actions(self => {
return {
authenticated() {self.authenticating = false}
}
})