-
ssh_configman page tells us how to configure multiple ssh accouts per PC -
Create a new SSH Key
$ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
// Calls the specified function [block] with `this` value as its argument and returns its result.
public inline fun <T, R> T.let(block: (T) -> R): R
//Calls the specified function [block] with `this` value as its receiver and returns its result.
public inline fun <T, R> T.run(block: T.() -> R): R
//Calls the specified function [block] with the given [receiver] as its receiver and returns its result.
public inline fun <T, R> with(receiver: T, block: T.() -> R): R
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
| async function fetchA() { | |
| return new Promise(resolve => { | |
| setTimeout(function() { | |
| resolve("slow"); | |
| console.log("slow promise is done"); | |
| }, 4000); | |
| }); | |
| } | |
| async function fetchB() { |
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
| #!/usr/bin/env python3 | |
| # -*- coding: utf-8 -*- | |
| # Copyright (C) 2015-2017 Carlos Jenkins <carlos@jenkins.co.cr> | |
| # | |
| # 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 | |
| # |
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
| #!/bin/sh | |
| #ktlint-git-pre-commit-hook-android.sh | |
| git diff --name-only --cached --relative | grep '\.kt[s"]\?$' | xargs ktlint --android --relative . | |
| if [ $? -ne 0 ]; then exit 1; fi | |
| #ktlint-git-pre-push-hook-android.sh | |
| # https://github.com/shyiko/ktlint pre-push hook | |
| git diff --name-only HEAD origin/$(git rev-parse --abbrev-ref HEAD) | grep '\.kt[s"]\?$' | xargs ktlint --android --relative . | |
| if [ $? -ne 0 ]; then exit 1; fi |
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 android.content.Context; | |
| import android.support.v7.widget.RecyclerView; | |
| import android.util.AttributeSet; | |
| import android.view.View; | |
| /** | |
| * {@link GridLayoutManager} extension which introduces workaround for focus finding bug when | |
| * navigating with dpad. | |
| * | |
| * @see <a href="http://stackoverflow.com/questions/31596801/recyclerview-focus-scrolling">http://stackoverflow.com/questions/31596801/recyclerview-focus-scrolling</a> |
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
| #!/usr/bin/env python3 | |
| import fileinput | |
| # Read in the file | |
| with open('file.txt', 'r') as file : | |
| filedata = file.read() | |
| # Replace the target string | |
| filedata = filedata.replace('ram', 'abcd') |
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
| #!/usr/bin/env python3 | |
| import fileinput | |
| # Read in the file | |
| with open('file.txt', 'r') as file : | |
| filedata = file.read() | |
| # Replace the target string | |
| filedata = filedata.replace('ram', 'abcd') |
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
| SourceUnit unit = SourceUnit.create("gradle", gradleFileToString); | |
| unit.parse(); | |
| unit.completePhase(); | |
| unit.convert(); | |
| visitScriptCode(unit, new parseBuildGradle()); | |
| private void visitScriptCode(SourceUnit source, GroovyCodeVisitor transformer) { | |
| source.getAST().getStatementBlock().visit(transformer); | |
| for (Object method : source.getAST().getMethods()) { | |
| MethodNode methodNode = (MethodNode) method; |
OlderNewer