# spec/support/request_helpers.rb
module Requests
module JsonHelpers
def json
JSON.parse(response.body)
end
end
end
View .gitlab-ci.yml
This file contains 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
stages: | |
- pre-build | |
migrate-test: | |
image: node:12 | |
stage: pre-build | |
only: | |
- master | |
allow_failure: false | |
before_script: |
View PgTypesLibphonenumberPlugin.ts
This file contains 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
import { Plugin, Build, ScopeGraphQLScalarType } from "graphile-build"; | |
import { PhoneNumber, parsePhoneNumber } from "libphonenumber-js"; | |
declare module "graphile-build" { | |
interface ScopeGraphQLScalarType { | |
isPhoneNumberScalar: boolean; | |
} | |
} | |
export default (function PgTypesLibphonenumberPlugin(builder) { |
View overlay_container.dart
This file contains 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
import 'package:flutter/material.dart'; | |
class OverlayContainer extends StatefulWidget { | |
/// The child to render in the regular document flow (defaults to Container()) | |
final Widget child; | |
/// The widget to render inside the [OverlayEntry]. | |
final Widget overlay; | |
/// Offset to apply to the [CompositedTransformFollower] |
View rubber_range_picker.dart
This file contains 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
import 'dart:math' as math; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/rendering.dart'; | |
import 'package:flutter/scheduler.dart'; | |
void main() => runApp(ExampleApp()); | |
class ExampleApp extends StatelessWidget { | |
@override |
View ScreenPagerStateAdapter.java
This file contains 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
package com.ghm.ui.adapter; | |
import android.content.Context; | |
import android.os.Bundle; | |
import android.os.Parcelable; | |
import android.support.v4.view.PagerAdapter; | |
import android.util.SparseArray; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; |
View rspec_json_helper.md
View GlideHelper.java
This file contains 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
import android.content.Context; | |
import android.support.annotation.NonNull; | |
import android.widget.ImageView; | |
import com.bumptech.glide.Glide; | |
import com.bumptech.glide.Priority; | |
import com.bumptech.glide.load.data.DataFetcher; | |
import com.bumptech.glide.load.model.stream.StreamModelLoader; |
View gist:5823184
#Intro
Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3
Kotlin project website is at kotlin.jetbrains.org.
All the codes here can be copied and run on Kotlin online editor.
Let's get started.
View gist:4471560
This file contains 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 | |
require "sequel" | |
Sequel.extension :migration | |
DB = Sequel.connect(ENV['DATABASE_URL']) | |
desc "Prints current schema version" | |
task :version do | |
version = if DB.tables.include?(:schema_info) | |
DB[:schema_info].first[:version] | |
end || 0 |
View ruby_ftp_example.rb
This file contains 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
require 'net/ftp' | |
CONTENT_SERVER_DOMAIN_NAME = "one-of-the-ftp-server.thought-sauce.com.hk" | |
CONTENT_SERVER_FTP_LOGIN = "saucy-ftp-server-login" | |
CONTENT_SERVER_FTP_PASSWORD = "saucy-ftp-server-password" | |
# LOGIN and LIST available files at default home directory | |
Net::FTP.open(CONTENT_SERVER_DOMAIN_NAME, CONTENT_SERVER_FTP_LOGIN, CONTENT_SERVER_FTP_PASSWORD) do |ftp| | |
files = ftp.list |
NewerOlder