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
cd /tmp | |
curl -o git-2.2.1.tar.gz "https://www.kernel.org/pub/software/scm/git/git-2.2.1.tar.gz" | |
curl -o git-2.2.1.tar.sign "https://www.kernel.org/pub/software/scm/git/git-2.2.1.tar.sign" | |
# if you want to verify the tar signature | |
gpg --keyserver hkp://keys.gnupg.net --recv-keys 96AFE6CB | |
gunzip git-2.2.1.tar.gz | |
gpg --verify git-2.2.1.tar.sign |
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
#In Golang | |
package main | |
import ( | |
"fmt" | |
"regexp" | |
) | |
func main() { |
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
#The task is replacing the port number in the URL string | |
//in golang | |
import "fmt" | |
import "strings" | |
func main() { | |
url := "http://localhost:8080/foo/bar" | |
fmt.Println(strings.Replace(url, "8080", "8181", -1)) | |
} |
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
// The wrong way to do things: | |
for { | |
switch { | |
case <- channelA: | |
doSomething() | |
case <- channelB: | |
doSomethingElse() | |
default: | |
// Do nothing. |
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
// When I was working on our React/Flummox app I got to the point where, per the docs, I had ~100 lines of code | |
// which were substantially predictable boilerplate, so I used some JS metaprogramming to condense them by 80%. | |
// Flummox docs: http://acdlite.github.io/flummox | |
// I use underscore.js below for utility but you can also just do a for loop. | |
class AppFlux extends Flux { | |
constructor() { |
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
vars: | |
starfighters: | |
- username: patrick | |
github: patio11 | |
name: "Patrick McKenzie" | |
- username: thomas | |
github: tqbf | |
name: "Thomas Ptacek" | |
- username: erin | |
github: boboTjones |
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
/* | |
* robotMaze.js | |
* | |
* The blue key is inside a labyrinth, and extracting | |
* it will not be easy. | |
* | |
* It's a good thing that you're a AI expert, or | |
* we would have to leave empty-handed. | |
*/ |
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
//JSON to POST to /venues/FOOEX/stocks/BAR/orders | |
{ | |
“symbol”: “BAR”, | |
“venue”: “FOOEX”, | |
“direction”: “buy”, | |
“qty”: 20, | |
“price”: 5100, | |
“type”: “limit”, | |
“account” : “OGB12345”, // your trading account (game gives you this) |
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
<!DOCTYPE html> | |
<html lang='en'> | |
<head> | |
<link rel="stylesheet" type="css/text" href="https://dwpnibhogf8y5.cloudfront.net/static/css/bootstrap.min-f04b517b.css" /> | |
<body> | |
<div class="alert alert-danger">This text should be styled.</div> | |
</body> | |
</html> | |
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 SlackController < ApplicationController | |
skip_before_action :verify_authenticity_token | |
@@slack_security_tokens = | |
["copy-paste-the-token-you-get-from-Slack-when-configuring-the-integration-here"] | |
before_filter :bounce_access_not_from_slack | |
def healthcheck | |
services = SystemStatus.list_services |