Skip to content

Instantly share code, notes, and snippets.

@franzejr
franzejr / introspection_query.graphql
Created October 18, 2018 14:01
GraphQL full Introspection query
query IntrospectionQuery {
__schema {
queryType { name }
mutationType { name }
subscriptionType { name }
types {
...FullType
}
directives {
name
@franzejr
franzejr / postgresql_adapter.rb
Last active December 26, 2021 17:25
Active Record 4.2.1 connection adapters - error: PG::InvalidParameterValue: ERROR: invalid value for parameter "client_min_messages": "panic" HINT: Available values: debug5, debug4, debug3, debug2, debug1, log, notice, warning, error. : SET client_min_messages TO 'panic'
# /Users/franzejr/.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/activerecord-4.2.1
# Changes in activerecord (4.2.1) lib/active_record/connection_adapters/postgresql_adapter.rb
# Enable standard-conforming strings if available.
def set_standard_conforming_strings
old, self.client_min_messages = client_min_messages, 'notice'
execute('SET standard_conforming_strings = on', 'SCHEMA') rescue nil
ensure
self.client_min_messages = old
end

Keybase proof

I hereby claim:

  • I am franzejr on github.
  • I am franzejr (https://keybase.io/franzejr) on keybase.
  • I have a public key ASCMzXBDFx3QIGQFLXwAhGd1hzHZCAfDbRNhQhIWtVPdkQo

To claim this, I am signing this object:

@franzejr
franzejr / .rubocop.yml
Last active August 24, 2017 14:09
Rubocop config file
# see https://github.com/bbatsov/rubocop#configuration
# for info on how to configure rubocop
# see https://github.com/bbatsov/rubocop/blob/master/config/default.yml
# for default configuration
AllCops:
TargetRubyVersion: 2.3
Exclude:
- vendor/**/*
- notes.*
@franzejr
franzejr / with_scroll_higher_order_component.js
Created April 27, 2016 02:28
withScroll Higher Order Component
var getScroll = function() {
return (window.pageYOffset !== undefined) ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop
}
var withScroll = function(Component) {
return React.createClass({
getInitialState: function() {
return {
scroll: getScroll()
}
@franzejr
franzejr / remove_trailing_whitespace.sh
Last active April 5, 2017 21:30
Removing trailing whitespace recursively from your project
#Removing trailing whitespace from .rb files
find -name '*.rb' -print0 | xargs -r0 sed -e 's/[[:blank:]]\+$//' -i
#Removing trailing whitespace from .erb files
find -name '*.erb' -print0 | xargs -r0 sed -e 's/[[:blank:]]\+$//' -i
# WORKING ON OSX
find . \( -name '*.rb' -or -name '*.js' -or \\n-name '*.css' -or -name '*.scss' -or -name '*.erb' -or -name '*.yml' -or -name '*.erb' \) \\n-print0 | xargs -0 sed -i '' -E "s/[[:space:]]*$//"
@franzejr
franzejr / SimpleDrawer.js
Created July 7, 2016 12:44
SimpleDrawer using Drawer React Native
import React, { Component } from 'react';
import Drawer from 'react-native-drawer';
import { DefaultRenderer } from 'react-native-router-flux';
import TabView from '../TabView/TabView';
export default class SimpleDrawer extends Component {
static propTypes = {
navigationState: React.PropTypes.object,
onNavigate: React.PropTypes.function,
}
@franzejr
franzejr / counter-react.js
Created March 6, 2016 03:40
Counter ReactJS
import React, { Component, PropTypes } from 'react'
class Counter extends Component {
constructor(props) {
super(props)
this.incrementAsync = this.incrementAsync.bind(this)
this.incrementIfOdd = this.incrementIfOdd.bind(this)
}
incrementIfOdd() {
@franzejr
franzejr / package.json
Created August 30, 2016 03:55
Add eslint to your React Native Project
{
"name": "My Application",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"lint": "eslint --fix *.js"
},
"dependencies": {
"react": "15.3.1",
@franzejr
franzejr / gist:c2f59f7da7847b995ab1cb4e26dcdfab
Last active August 29, 2016 19:25
Remote Meetup new version
- Something like rails_admin
- List Meetups from Bigmarker (http://docs.bigmarker.com/)
- List Meetups from Anywhere
- Add a meetup manually
- Run a job every night and get all the meetups from bigmarker
- Upcoming remote meetups
- Featured remote meetups(it has a priority related to the others)