This file contains hidden or 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
| ### An example of HTTP requests for Next.js + Next-auth.js (Auth.js) with credentials login | |
| ### for testing your API endpoints | |
| ### Variables | |
| @host = http://localhost:3000 | |
| @callback_url = http://localhost:3000/login | |
| @admin_email = admin@example.com | |
| @admin_password = secretpassword | |
| ### 1. GET CSRF token |
This file contains hidden or 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
| FROM ruby:2.3.1-alpine | |
| MAINTAINER Vadym Lukavyi <vadym@masterofcode.com> | |
| ENV BUILD_PACKAGES="curl-dev ruby-dev build-base" \ | |
| DEV_PACKAGES="zlib-dev libxml2-dev libxslt-dev tzdata yaml-dev postgresql-dev" \ | |
| RUBY_PACKAGES="ruby-json yaml nodejs" | |
| RUN apk update && \ | |
| apk upgrade && \ | |
| apk add --update\ |
This file contains hidden or 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
| # gems/grape-jbuilder-0.2.0/lib/grape/formatter/jbuilder.rb | |
| module Grape | |
| module Formatter | |
| class Jbuilder | |
| def call | |
| return Grape::Formatter::Json.call(object, env) unless template? | |
| start_time = Time.now | |
| r = Grape::Jbuilder::Renderer.new(env['api.tilt.root'], template). |
This file contains hidden or 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
| # concerns/event_log.rb | |
| module EventLog | |
| extend ActiveSupport::Concern | |
| included do | |
| has_many :logs, as: :logable, class_name: 'EventLogger' | |
| attr_accessor :current_user | |
| after_create :event_log_create | |
| after_update :event_log_update |
This file contains hidden or 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
| namespace :db do | |
| task migrations2sql: :environment do |task| | |
| SQL_FILES_DIR = Rails.root.join('tmp', 'sql') | |
| FileUtils.rm_rf(SQL_FILES_DIR, secure: true) | |
| Dir.mkdir(SQL_FILES_DIR) unless File.exists?(SQL_FILES_DIR) | |
| TMP_FILE = Tempfile.new('migrations2sql') |
This file contains hidden or 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
| <?php | |
| // стандарт КМУ2010 http://zakon5.rada.gov.ua/laws/show/55-2010-%D0%BF | |
| function cyr2lat($string) { | |
| $ukr = ['Є', 'Ї', 'Й', 'Ю', 'Я', 'є', 'ї', 'й', 'ю', 'я' ]; | |
| $lat = ['Ye', 'Yi', 'Y', 'Yu', 'Ya', 'ye', 'yi', 'y', 'yu', 'ya' ]; | |
| for ($i=0,$ic=sizeof($ukr); $i < $ic; $i++) { | |
| $string = preg_replace("/(^|\s)".$ukr[$i]."/u", '$1'.$lat[$i], $string); | |
| } |
This file contains hidden or 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
| $ openssl x509 -in cert.cer -inform DER -outform PEM -out cert.pem | |
| $ openssl pkcs12 -in key.p12 -out key.pem -nodes | |
| test: | |
| $ openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert cert.pem -key key.pem | |
| and final step: | |
| $ cat cert.pem key.pem > apn-development.pem |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta name="description" content="Phaser player sandbox 20x20" /> | |
| <script src="http://cdn.jsdelivr.net/phaser/2.2.2/phaser.min.js"></script> | |
| <meta charset="utf-8"> | |
| <title>Phaser player sandbox 20x20</title> | |
| </head> | |
| <body> |
This file contains hidden or 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
| # features/facebook.feature | |
| Feature: Sign Up | |
| In order to sign up | |
| As a user | |
| Should be able to sign up with facebook | |
| @omniauth_test | |
| Scenario: User sign in with facebook | |
| Given I am not logged in |