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
| package fmt | |
| import "fmt" | |
| func Printfln(format string, args ...interface{}) { | |
| fmt.Printf(format + "\n", args...) | |
| } |
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
| gemsize(gemname) { | |
| curl -s https://rubygems.org/api/v1/gems/$gemname.yaml | sed -n "s/gem_uri: //p" | xargs curl -sLI | grep Content-Length | tail -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
| # Removes all newlines and whitespace-only lines from a file | |
| minify(filename) { | |
| echo $(cat $filename | grep -v '^[[:space:]]*$') > $filename | |
| } |
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
| import { Component } from 'react'; | |
| import { withRouter } from 'react-router-dom'; | |
| class ScrollToTop extends Component { | |
| componentDidUpdate(prevProps) { | |
| if (this.props.location !== prevProps.location) { | |
| window.scrollTo(0, 0) | |
| } | |
| } |
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
| // Expected possible values: | |
| // X-Forwarded-Proto: https,http,http,http,http | |
| // X-Forwarded-Proto: http,http,http,http,http | |
| // X-Forwarded-Proto: https | |
| // X-Forwarded-Proto: http | |
| // X-Forwarded-Proto: wss | |
| export default (req, res, next) => { | |
| const protos = req.get('X-Forwarded-Proto') | |
| const clientToLb = protos && protos.split(',')[0] | |
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
| const http = require('http') | |
| function Request(options, body) { | |
| return new Promise((resolve, reject) => { | |
| const onSuccess = function(res) { | |
| let buffer = [] | |
| res.setEncoding('utf8') | |
| res.on('data', function(chunk) { |
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
| // Select is a drop-in replacement for HTML <select> elements for | |
| // React apps. It uses table UI components to simulate the quick | |
| // rendering of components that scroll into view. | |
| class Select extends Component { | |
| } | |
| class TableView extends Component { | |
| } |
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
| find . -type f -print0 | xargs -0 sed -i "" 's/DiffNameTwo/DiffNameThree/g' | |
| find . -type f | xargs sed -i '' 's/DiffNameTwo/DiffNameThree/g' | |
| find . -type f -exec rename 's/DiffNameTwo/DiffNameThree/g' {} \; | |
| perl -pi -w -e 's/DiffNameTwo/DiffNameThree/g;' ./* |
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
| SELECT | |
| b.id, | |
| b.url, | |
| b.archive_url, | |
| b.summary, | |
| t.name as tag, | |
| b.date | |
| FROM | |
| bulletin b | |
| INNER JOIN |
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
| /* | |
| * This Java source file was generated by the Gradle 'init' task. | |
| */ | |
| public class App { | |
| public String getGreeting() { | |
| return "Hello world."; | |
| } | |
| public static void main(String[] args) { |