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
== Rebar.config: | |
{erlydtl_opts,[{translation_fun, {agigo_util, translate}}]}. | |
== Error: | |
DEBUG: Worker compilation failed: {{error, | |
{'EXIT', | |
{badarg, |
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
-module(leetcode). | |
-export([min_window/0]). | |
%% Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n). | |
%% For example, | |
%% S = "ADOBECODEBANC" | |
%% T = "ABC" | |
%% Minimum window is "BANC". |
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
for i in `curl https://www.cloudflare.com/ips-v4`; do iptables -I INPUT -p tcp -s $i -m multiport --dports http,https -j ACCEPT; done | |
iptables -A INPUT -p tcp --dport http -j DROP | |
iptables -A INPUT -p tcp --dport https -j DROP | |
iptables-save > /etc/iptables/rules.v4 |
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
# web cluster nodes | |
# in this setup we have three local application servers | |
upstream web-cluster { | |
server a4.mzstatic.com; | |
#server 10.0.0.12; | |
#server 10.0.0.13; | |
} | |
# force redirect of http to https | |
# application will be available only over https |
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
module Foo where | |
import System.IO | |
-- define fold | |
myfold :: (Num b) => [(t, b)] -> b | |
myfold ((t,b):xs) = foldr (\(t,b) x -> x + b) 0 ((t,b):xs) | |
-- define writing results to file |
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
(setq server-socket-dir "~/.emacs.d/server") | |
(server-start) |
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 | |
puts `find -type f -name '*.php' | xargs perl -pi -w -e 's/#{ARGV[0]}/#{ARGV[1]}/g;'` |
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
{-# LANGUAGE OverloadedStrings #-} | |
import qualified System.ZMQ as ZMQ | |
import Data.Binary | |
import Data.Binary.Put | |
import Data.Binary.Get | |
import Data.ByteString.Lazy as LZ | |
import Data.ByteString as STR | |
import Data.Bson | |
import Data.Bson.Binary |
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 write com.apple.dock workspaces-swoosh-animation-off -bool YES && killall Dock |
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
-module(main). | |
-export([map/1]). | |
-export([main/0]). | |
-export([reducer_wrapper/1]). | |
-export([reducer/2]). | |
-define(NUMBER_OF_PARTITIONS, 100). | |
main() -> |
OlderNewer