Skip to content

Instantly share code, notes, and snippets.

View paveltyk's full-sized avatar

Pavel Tsiukhtsiayeu paveltyk

  • BILL
  • North Carolina, US
  • 19:30 (UTC -05:00)
View GitHub Profile
@a7v8x
a7v8x / graphql_introspection_query.graphql
Last active November 5, 2023 12:36
GraphQL introspection query - for fetching the whole schema (from GraphiQL IDE) for https://atheros.ai/blog/graphql-introspection-and-introspection-queries
query IntrospectionQuery {
__schema {
queryType { name }
mutationType { name }
types {
...FullType
}
directives {
name
description
@anthonyholmes
anthonyholmes / bootstrap-sass-mixin-cheatsheet.scss
Created October 10, 2014 08:13
Bootstrap Sass Mixin Cheatsheet
// Alerts
@include alert-variant($background, $border, $text-color);
// Background Variant
@include bg-variant($parent, $color);
// Border Radius
@include border-top-radius($radius);
@include border-right-radius($radius);
@include border-bottom-radius($radius);
@micho
micho / nginx.conf
Last active September 29, 2023 16:38 — forked from unixcharles/nginx.conf
nginx config for http/https proxy to localhost:3000
First, install nginx for mac with "brew install nginx".
Then follow homebrew's instructions to know where the config file is.
1. To use https you will need a self-signed certificate: https://devcenter.heroku.com/articles/ssl-certificate-self
2. Copy it somewhere (use full path in the example below for server.* files)
3. sudo nginx -s reload
4. Access https://localhost/
Edit /usr/local/etc/nginx/nginx.conf:
section: screens
desktop:
laptop:
end
section: aliases
desktop:
avsej-desktop.altoros.corp
avsej-desktop.local
avsej-desktop
@paveltyk
paveltyk / mock_geocoder.rb
Created October 10, 2011 14:48
Geocoder: Stub out address geocoding during RSpec unit tests
# In spec_helper:
# RSpec.configure do |config|
# ...
# config.include(MockGeocoder)
# end
#
# In your tests:
# it 'mock geocoding' do
# mock_geocoding! # You may pass additional params to override defaults (i.e. :coordinates => [10, 20])
# address = Factory(:address)
@paveltyk
paveltyk / hide_confirmation.jquey.js
Created July 27, 2011 19:16
jQuery plugin to auto show/hide confirmation field
/*!
* jQuery HideConfirmation Plugin
* version: 1.0 (27-JUL-2011)
* created by: PavelTyk https://github.com/PavelTyk
*
* This is a simple plugin to automatically hide confirmation fields if
* no changes made to observed field.
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
@paveltyk
paveltyk / jquery.twit_char_counter.js
Created March 10, 2011 11:27
TwitCharCounter jQuery plugin
/*!
* jQuery TwitCharCounter Plugin
* version: 1.0 (10-MAR-2011)
* created by: PavelTyk
*
* This is a simple char counter plugin (like the Twitter one). It has flexible
* settings and allows minimize configuration settings.
*
* Examples and documentation at: https://gist.github.com/863967
@reagent
reagent / etsy_verification_app.rb
Created November 7, 2010 02:26
A simple Sinatra app to test the OAuth callback functionality in Etsy. To use: 1. Install dependencies 2. Supply a valid api key & secret 3. Run `ruby etsy_verification_app.rb` 4. Point a browser to http://localhost:4567/
require 'rubygems'
require 'sinatra'
require 'etsy'
enable :sessions
Etsy.access_mode = :read_write
Etsy.api_key = "key"
Etsy.api_secret = "secret"
Etsy.callback_url = "http://localhost:4567/verify"
@njvitto
njvitto / deploy.rake
Created April 11, 2010 16:56 — forked from RSpace/deploy.rake
Rakefile to deploy and rollback to Heroku in two different environments (staging and production) for the same app
#Deploy and rollback on Heroku in staging and production
task :deploy_staging => ['deploy:set_staging_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
task :deploy_production => ['deploy:set_production_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
namespace :deploy do
PRODUCTION_APP = 'YOUR_PRODUCTION_APP_NAME_ON_HEROKU'
STAGING_APP = 'YOUR_STAGING_APP_NAME_ON_HEROKU'
task :staging_migrations => [:set_staging_app, :push, :off, :migrate, :restart, :on, :tag]
task :staging_rollback => [:set_staging_app, :off, :push_previous, :restart, :on]