This file contains hidden or 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
| # +--------------------+ | |
| # | | | |
| # | GENERAL CONFIG | | |
| # | | | |
| # +--------------------+ | |
| PROBLEM_NAME := problem_name | |
| DEBUG := true | |
| LANG := cpp |
This file contains hidden or 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
| -- copy.lua | |
| -- | |
| -- Lua functions of varying complexity to deep copy tables. | |
| -- | |
| -- 1. The Problem. | |
| -- | |
| -- Here's an example to see why deep copies are useful. Let's | |
| -- say function f receives a table parameter t, and it wants to |
This file contains hidden or 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
| (def default-wait-death (time/seconds 5)) | |
| (def default-wait-delay-ms 10) | |
| (defn wait-until* | |
| "wait until a function has become true" | |
| ([name fn] (wait-until* name fn default-wait-death)) | |
| ([name fn wait-death] | |
| (let [die (time/plus (time/now) wait-death)] | |
| (loop [] | |
| (if-let [result (fn)] |
This file contains hidden or 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
| [self.apiClient retrieveConnectedServicesWithSuccessBlock:^(NSDictionary *services) { | |
| NSArray *facebookTokens = services[@"facebook"]; | |
| if (facebookTokens.count == 0) { | |
| return; | |
| } | |
| NSDictionary *mostRecentFacebookTokenDict = facebookTokens[0]; | |
| NSNumber *refreshTimeNumber = mostRecentFacebookTokenDict[@"refreshTime"]; | |
| NSDate *refreshDate = [NSDate dateWithTimeIntervalSince1970:[refreshTimeNumber doubleValue]]; |
This file contains hidden or 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
| // | |
| // Created by Stan Serebryakov on 03/02/15. | |
| // | |
| import UIKit | |
| @UIApplicationMain | |
| class AppDelegate: UIResponder, UIApplicationDelegate { | |
| var window: UIWindow? |
This file contains hidden or 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
| global | |
| tune.ssl.default-dh-param 1024 | |
| defaults | |
| timeout connect 10000ms | |
| timeout client 60000ms | |
| timeout server 60000ms | |
| frontend fe_http | |
| mode http |
This file contains hidden or 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
| let s:enabled_options = [ | |
| \ 'target', 'emitDecoratorMetadata', 'experimentalDecorators', 'module', | |
| \ 'noImplicitAny', 'rootDir', 'noEmit', 'allowSyntheticDefaultImports', | |
| \ 'noImplicitReturn', 'allowUnreachableCode', 'allowUnusedLabels' | |
| ] | |
| function! neomake#makers#ft#typescript#tsc() | |
| let l:tsconfig = findfile('tsconfig.json', '.;') | |
| if len(l:tsconfig) | |
| let true = 1 |
This file contains hidden or 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
| # On slow systems, checking the cached .zcompdump file to see if it must be | |
| # regenerated adds a noticable delay to zsh startup. This little hack restricts | |
| # it to once a day. It should be pasted into your own completion file. | |
| # | |
| # The globbing is a little complicated here: | |
| # - '#q' is an explicit glob qualifier that makes globbing work within zsh's [[ ]] construct. | |
| # - 'N' makes the glob pattern evaluate to nothing when it doesn't match (rather than throw a globbing error) | |
| # - '.' matches "regular files" | |
| # - 'mh+24' matches files (or directories or whatever) that are older than 24 hours. | |
| autoload -Uz compinit |
This file contains hidden or 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
| -- Show loaded modules in window title and use a green "λ>" as prompt. | |
| -- Subsequent lines of multi-line commands shall begin with " |". | |
| :set prompt "\SOH\ESC]0;GHCi: %s\BEL\ESC[32;1m\STXλ>\SOH\ESC[0m\STX " | |
| :set prompt2 "\SOH\ESC[32;1m\STX |\SOH\ESC[0m\STX " | |
| -- Paste and evaluate text from the OS X clipboard. (The pasted text also | |
| -- prints in yellow unless pasting quietly using :paste-quiet.) | |
| :set -package process | |
| :def paste \_ -> do { paste <- System.Process.readProcess "pbpaste" [] ""; let cmd = if '\n' `elem` paste then ":{\ntype Ö = ()\n" ++ paste ++ "\n:}" else paste in putStrLn ("\SOH\ESC[33m\STX" ++ paste ++ "\SOH\ESC[0m\STX") >> return (":cmd return " ++ show cmd) } | |
| :def paste-quiet \_ -> do { paste <- System.Process.readProcess "pbpaste" [] ""; let cmd = if '\n' `elem` paste then ":{\ntype Ö = ()\n" ++ paste ++ "\n:}" else paste in return (":cmd return " ++ show cmd) } |
This file contains hidden or 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
| (defn print-threads [& {:keys [headers pre-fn] | |
| :or {pre-fn identity}}] | |
| (let [thread-set (keys (Thread/getAllStackTraces)) | |
| thread-data (mapv bean thread-set) | |
| headers (or headers (-> thread-data first keys))] | |
| (clojure.pprint/print-table headers (pre-fn thread-data)))) | |
| (defn print-threads-str [& args] | |
| (with-out-str (apply print-threads args))) |