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
Create separate SSH key for your personal account and your company. Named them with different extensions in your .ssh folder. Upload them to your github account and finally create a config file for your SSH | |
Create a config file in ~/.ssh/ | |
vim config: | |
# PERSONAL ACCOUNT Github | |
Host github.com-COOL | |
HostName github.com | |
User git | |
IdentityFile ~/.ssh/id_rsa_COOL |
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
CertificatePinner certificatePinner = new CertificatePinner.Builder() | |
.add("api.github.com", "sha256/6wJsqVDF8K19zxfLxV5DGRneLyzso9adVdUN/exDacw=") | |
.build(); | |
final OkHttpClient client = httpBuilder.certificatePinner(certificatePinner).build(); | |
Retrofit retrofit = new Retrofit.Builder() | |
.baseUrl(END_POINT) | |
.addConverterFactory(GsonConverterFactory.create()) | |
.client(client) |
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
public class TLSSocketFactory extends SSLSocketFactory { | |
private SSLSocketFactory internalSSLSocketFactory; | |
public TLSSocketFactory() throws KeyManagementException, NoSuchAlgorithmException { | |
SSLContext sslContext = SSLContext.getInstance("TLS"); | |
sslContext.init(null, new TrustManager[] { systemDefaultTrustManager() }, null); | |
internalSSLSocketFactory = sslContext.getSocketFactory(); | |
} |
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
/** | |
* Force the connection to use only TLS v.1.2 avoiding the fallback to older version to avoid vulnerabilities | |
* | |
*/ | |
final ConnectionSpec.Builder connectionSpec = | |
new ConnectionSpec.Builder(ConnectionSpec.MODERN_TLS); | |
connectionSpec.tlsVersions(TlsVersion.TLS_1_2).build(); |
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
openssl s_client -connect api.github.com:443 | openssl x509 -pubkey -noout | openssl rsa -pubin -outform der | openssl dgst -sha256 -binary | openssl enc -base64 |
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
alias npmbin='echo -e "Setting up npmbin with path:\n$(npm bin)"; export PATH=$(npm bin):$PATH' |
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
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.graphics.Canvas; | |
import android.graphics.Color; | |
import android.graphics.Paint; | |
import android.graphics.Rect; | |
import android.graphics.Typeface; | |
import android.util.AttributeSet; | |
import android.view.View; |
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
#!/bin/bash | |
_git_has_commits() { | |
if git rev-parse --verify HEAD > /dev/null 2>&1; then | |
return 0 | |
else | |
return 1 | |
fi |
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
/* | |
* Copyright (C) 2013 Square, Inc. | |
* | |
* 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 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
import dateMixin from './mixins/date'; | |
// Globally | |
Vue.mixin(dateMixin); |
OlderNewer