docker swarm init
# 创建管理环境
docker-machine create \
--driver generic \
--generic-ip-address=IP \
--generic-ssh-key ~/.ssh/id_rsa \
--swarm --swarm-master \
taxigo
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 { | |
ApolloClient, | |
from, | |
HttpLink, | |
InMemoryCache, | |
NormalizedCacheObject, | |
split, | |
} from '@apollo/client' | |
import { onError } from '@apollo/client/link/error' | |
import { concatPagination, getMainDefinition } from '@apollo/client/utilities' |
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
# ***************************************************************************** | |
# * Base image based on offical ruby alpine image with minimal dependencies. * | |
# ***************************************************************************** | |
FROM ruby:3.1.0-alpine as base | |
RUN apk add --update --no-cache ca-certificates gcompat libpq tzdata | |
# ***************************************************************************** | |
# * Builder image with all dependencies installed. * | |
# ***************************************************************************** |
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
ruby '2.7.1' | |
gem 'rails', github: 'rails/rails' | |
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data | |
# Action Text | |
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra' | |
gem 'okra', github: 'basecamp/okra' | |
# Drivers |
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
# This is an example of metaprogramming in the Elixir language. | |
# | |
# We will define a domain specific language (DSL) for the definition | |
# of a service which is watched by several sensors. | |
# Each sensor watches some property/functionality of the service and | |
# returns the result of the check. | |
# | |
# To determine if the service is functioning properly, we need functions | |
# to run all the sensors' code and gather the returned data. | |
# |
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
#!/usr/bin/sudo sh | |
## ruby_revealer.sh -- decrypt obfuscated GHE .rb files. 2.0.0 to 2.3.1+. | |
## From `strings ruby_concealer.so`: | |
## | |
## > This obfuscation is intended to discourage GitHub Enterprise customers | |
## > from making modifications to the VM. | |
## | |
## Well, good, as long as its not intended to discourage *me* from doing this! |
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
// Initializes MultiTargetingConnectivity with current PC culture | |
var connectivity = new MultiTargetingConnectivity(Thread.CurrentThread.CurrentUICulture.LCID); | |
var devices = connectivity.GetConnectableDevices(); | |
// Gets the first physical device attached to PC. | |
// WARNING: if more than a single device is connected to the PC deploy will fail. | |
var phone = devices.FirstOrDefault(x => !x.IsEmulator()); | |
// PhoneProductId of the app, you can find it in your Package.appxmanifest | |
var package = Guid.Parse("XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"); |
This little post aims to help you to translate Objective-C Blocks into Ruby blocks. Let's start by taking a look at few examples of iOS API call where blocks are used for animations and enumeration
Im Rubymotion and MacRuby you can use all the Ruby Lambda syntaxes that are:
block = lambda { |param| ... }
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
# config/locales/en.yml | |
en: | |
exception: | |
show: | |
not_found: | |
title: "Not Found" | |
description: "The page you were looking for does not exists." | |
internal_server_error: | |
title: "Internal Server Error" |
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
class Api | |
class << self | |
# Init API server, with the shared client | |
def init_server | |
if Auth.needlogin? | |
AFMotion::SessionClient.build_shared(BASE_URL) do | |
session_configuration :default | |
header "Accept", "application/json" |
NewerOlder