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 AddColumnsForAttrEncrypted < ActiveRecord::Migration[5.2] | |
def change | |
tasks = { | |
alipays: [:private_key], | |
crawlers: [:username, :password], | |
delivery_platforms: [:key, :secret, :brand_key, :sid], | |
meituans: [:api_key], | |
wechat_service_accounts: [:wechat_pay_api_key, :wechat_pay_certificate] | |
} |
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
rg 'ERROR -- : reaped' unicorn.stderr.log |\ | |
awk '{ r=match($14, /worker=(.*)/, a); system("rg \x27#" $10 "\x27 production." a[1] ".log | tail -1 | awk \x27{ print substr($7, 2, 36) }\x27 " ) }' |\ | |
awk '{ system("rg \x27" $0 ".*Started\x27 production.*.log") }' |
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
window.$ = jQuery; | |
nextPage = () => new Promise((resolve => { | |
$('[data-role=next]').click(); | |
$(document).one("ajaxComplete", () => { | |
resolve() | |
}) | |
})); |
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
redis-keys-size() { | |
redis-cli keys "$1" | awk '{ system("redis-cli memory usage \x27" $0 "\x27") }' | cut -d ' ' -f 2 | awk '{s+=$1} END {print s}' | |
} |
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
# vim: set nu sw=2 sts=2: | |
require 'zlib' | |
class LogParser | |
class Request | |
attr_accessor :path, :method, :ip, :started_at, :end_at, :status, :duration, :parameters, :api_key, :id | |
def parameters=(parameters) | |
@parameters = parameters |
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
if Rails.env.development? | |
require "base64" | |
module Sprockets | |
module CoffeeScriptProcessor | |
DEFAULT_OPTIONS = { "sourceMap" => true } | |
def self.call(input) | |
data = input[:data] | |
input[:cache].fetch([self.cache_key, data]) do |
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
.modal { | |
position: fixed; | |
width: 100%; | |
height: 100%; | |
top: 0; | |
left: 0; | |
z-index: 100; | |
.bg { | |
position: absolute; |
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.jikabao.scala.merchant | |
import java.util | |
import java.util.{Collections, Date} | |
import com.google.common.collect.{Lists, Iterables} | |
import com.jikabao.common.ServiceResult | |
import com.jikabao.common.domain._ | |
import com.jikabao.common.enums.QrCodeActionEnum._ | |
import com.jikabao.common.service.UserHolder |
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.lettrs.lettrs.view; | |
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.util.AttributeSet; | |
import android.widget.RelativeLayout; | |
import com.lettrs.lettrs.R; | |
import lombok.Getter; | |
import lombok.Setter; |
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
#!/bin/bash | |
# | |
# genstrings which searchs both Objective-C .m files and Swift files | |
# | |
# Set the 'PROJECT' variable | |
# I'm using a short function 'LS' to replace NSLocalizedString. This script searches them both. | |
# | |
if ! type -P ggrep >/dev/null; then | |
>&2 echo "Error: GNU grep 'ggrep' not found. Install by 'brew install homebrew/dupes/grep'" |
NewerOlder