brew install bash sudo bash -c "echo $(brew --prefix)/bin/bash >> /private/etc/shells"
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
// ==UserScript== | |
// @name Change User Agent to Edge for Microsoft websites | |
// @namespace http://tampermonkey.net/ | |
// @version 1.0 | |
// @description Changes the user agent to Edge when visiting Microsoft websites | |
// @match https://*.bing.com/* | |
// @match https://*.microsoft.com/* | |
// @match https://*.outlook.com/* | |
// @grant none | |
// ==/UserScript== |
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
set dFolder to "~/Desktop/screencapture/" | |
do shell script ("mkdir -p " & dFolder) | |
set i to 0 | |
repeat 960 times | |
do shell script ("screencapture " & dFolder & "frame-" & i & ".png") | |
delay 30 -- Wait for 30 seconds. | |
set i to i + 1 | |
end repeat |
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
-- Ignore generated target/ in certain Dropbox folders. | |
function igonreWater(paths, flags) | |
for idx, path in pairs(paths) do | |
if path:sub(-6) == "target" and flags[idx].itemIsDir == true and flags[idx].itemRenamed == true and flags[idx].itemXattrMod ~= true then | |
print("Ignoring" .. path) | |
hs.execute(string.format("xattr -w com.dropbox.ignored 1 '%s'", path)) | |
end | |
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
use std::future::Future; | |
use std::pin::Pin; | |
use std::task::{Context, Poll}; | |
use std::time::{Duration, Instant}; | |
struct Inspect<F>(F); | |
impl<F: Future> Future for Inspect<F> { | |
type Output = F::Output; |
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
// ==UserScript== | |
// @name 显示豆瓣用户id和性别 | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author J.Y Han | |
// @match https://www.douban.com/people/* | |
// @grant showDoubanIdAndGender | |
// ==/UserScript== |
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
[defaults] | |
sudo_flags = SSH_AUTH_SOCK="$SSH_AUTH_SOCK" -H -S -n | |
[ssh_connection] | |
ssh_args=-o ForwardAgent=yes |
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
# Copyright 2015 Google Inc. All Rights Reserved. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, |
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/bash | |
# ncp - Netcat and Pigz based network file copy (faster than scp, but unencrypted) | |
# From this blog post | |
# http://intermediatesql.com/linux/scrap-the-scp-how-to-copy-data-fast-using-pigz-and-nc/ | |
FILE_FULL=$1 | |
REMOTE_HOST=$2 | |
FILE_DIR=$(dirname $FILE_FULL) |
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
# Reference: | |
https://www.cloudgear.net/blog/2015/5-minutes-kubernetes-setup/ | |
# install homebrew and cask | |
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
# install virtualbox | |
brew cask install virtualbox | |
# install dockertoolbox |
NewerOlder