Skip to content

Instantly share code, notes, and snippets.

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@jopedroliveira
jopedroliveira / serve.py
Created March 20, 2023 22:10 — forked from chrisbolin/serve.py
Python SimpleHTTPServer for Static Serving (React / Angular / Ember) in HTML5 mode (a la mod_rewrite)
'''
Taken from:
http://stackoverflow.com/users/1074592/fakerainbrigand
http://stackoverflow.com/questions/15401815/python-simplehttpserver
'''
import SimpleHTTPServer, SocketServer
import urlparse, os
PORT = 3000
@jopedroliveira
jopedroliveira / fix_github_https_repo.sh
Created July 21, 2021 17:10 — forked from m14t/fix_github_https_repo.sh
Convert HTTPS github clones to use SSH
#/bin/bash
#-- Script to automate https://help.github.com/articles/why-is-git-always-asking-for-my-password
REPO_URL=`git remote -v | grep -m1 '^origin' | sed -Ene's#.*(https://[^[:space:]]*).*#\1#p'`
if [ -z "$REPO_URL" ]; then
echo "-- ERROR: Could not identify Repo url."
echo " It is possible this repo is already using SSH instead of HTTPS."
exit
fi
package adefault.com.pointt;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.PointF;
import android.media.Image;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MotionEvent;
%% CREATING NETWORK
beep
networkName = 'layrecnet';
disp(strcat('network type: ',networkName));
% networkName = 'feedforwardnet';
% networkName = 'newrb';
beep
Delay =input('Delay: ');
%% CREATING NETWORK
beep
networkName = 'layrecnet';
disp(strcat('network type: ',networkName));
% networkName = 'feedforwardnet';
% networkName = 'newrb';
beep
Delay =input('Delay: ');
function [sensitivity,specificity,accuracy] = getPerformance(output,testFinalTarget)
%
% [sensitivity,specificity,accuracy] = getPerformance(output,testFinalTarget)
%
% based on:
%
% sensitivity = truePositives / (truePositives + falseNegatives);
% specificity = trueNegatives / (falsePositives + trueNegatives);
% accuracy = (truePositives + trueNegatives) / (truePositives + trueNegatives + falsePositives + falseNegatives);
%
array = [mat2cell(networkName),mat2cell(num2str(numberOfHydenLayers)),mat2cell(transferFunction),mat2cell(num2str(Delay)),mat2cell(num2str(sensitivity)),mat2cell(num2str(specificity)),mat2cell(num2str(accuracy))];
sucess = xlsappend('data.xlsx',array);
%data.xlsx é o teu ficheiro. Ele vai adicionar à linha abaixo da ultima preenchida.
package dataBaseClothesPk;
import java.sql.Connection;
import java.sql.Statement;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
public class getServerConnection {
close all, clear all, clc;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Computacao neuronal e sistemas difusos - mestrado integrado em engenharia
%biomedica 2014/2015
%Elaborado por:
%Gabriela Lopes Costa
%Jose Pedro Oliveira
%
%duvidas ou sugestoes: [email protected]