made with esnextbin
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
/******/ (function(modules) { // webpackBootstrap | |
/******/ // The module cache | |
/******/ var installedModules = {}; | |
/******/ | |
/******/ // The require function | |
/******/ function __webpack_require__(moduleId) { | |
/******/ | |
/******/ // Check if module is in cache | |
/******/ if(installedModules[moduleId]) { | |
/******/ return installedModules[moduleId].exports; |
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/env ruby | |
require 'net/telnet' | |
cache_dump_limit = 100 | |
localhost = Net::Telnet::new("Host" => "localhost", "Port" => 11211, "Timeout" => 3) | |
slab_ids = [] | |
localhost.cmd("String" => "stats items", "Match" => /^END/) do |c| | |
matches = c.scan(/STAT items:(\d+):/) | |
slab_ids = matches.flatten.uniq | |
end |
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/sh | |
port=$1 | |
pid=`lsof -i :${port} -P -t -sTCP:LISTEN` | |
dir=`lsof -p ${pid} | awk '$4=="cwd" {print $9}'` | |
cmd=`ps -o command -p ${pid} | sed -n 2p` | |
echo "${cmd} in ${dir}" |
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
# 更换身份 | |
> telnet localhost 9051 | |
AUTHENTICATE | |
SETCONF ExitNodes={us} | |
SETCONF StrictNodes=1 | |
SIGNAL NEWNYM | |
QUIT | |
Or |
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
# app/constraints/role_constraint.rb | |
class RoleConstraint | |
def initialize(*roles) | |
@roles = roles.map { |r| r.to_s } | |
end | |
def matches?(request) | |
@roles.include? request.env['warden'].user(:user).try(:role) | |
end | |
end |
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/sh | |
COLOR_GREEN='\033[0;32m' | |
echo "${COLOR_GREEN}Remove node_modules." | |
rm -rf node_modules | |
echo "${COLOR_GREEN}Remove yarn.lock." | |
rm -f yarn.lock | |
if command -v ayarn > /dev/null 2>&1; then | |
echo "${COLOR_GREEN}Install node_modules use ayarn." |
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 { Table, Icon, Popover, Input } from 'antd'; | |
class EditableTable extends React.Component { | |
constructor(props) { | |
super(props); | |
this.columns = [{ | |
title: '应用名称', | |
dataIndex: 'appName', | |
key: 'appName', |
made with esnextbin
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
// Welcome! require() some modules from npm (like you were using browserify) | |
// and then hit Run Code to run your code on the right side. | |
// Modules get downloaded from browserify-cdn and bundled in your browser. | |
const React = require('react') | |
const tuku = require('tuku') | |
const router = require('tuku/router') |