Skip to content

Instantly share code, notes, and snippets.

View jbutko's full-sized avatar

Jozef Butko jbutko

View GitHub Profile
@jbutko
jbutko / How to set up two SSH keys for two GitLab accounts.md
Last active August 31, 2021 10:27
How to set up two SSH keys for two GitLab accounts

Simply declare each private ssh keys in a %HOME%/.ssh/config file:

Host gitlabuser1
    User git
    Hostname {hostname}
    PreferredAuthentications publickey
    IdentityFile C:/Users/{username}/.ssh/id_rsa1

Host gitlabuser2
@jbutko
jbutko / config.toml
Created March 9, 2018 08:15
Parity testnet config
[parity]
mode = "last"
mode_timeout = 300
mode_alarm = 3600
auto_update = "none"
release_track = "current"
public_node = false
no_download = false
no_consensus = false
no_persistent_txqueue = false
@jbutko
jbutko / web3-get-current-provider.js
Created February 28, 2018 08:46
web3.js - get current provider
getProviderName = () => {
let providerName = "UNKNOWN"
if(window.web3.currentProvider.constructor.name === "MetamaskInpageProvider")
providerName = "METAMASK"
else if(window.web3.currentProvider.constructor.name === "EthereumProvider")
providerName = "MIST"
else if(window.web3.currentProvider.constructor.name === "o")
@jbutko
jbutko / statelessComponent.tsx
Last active July 8, 2020 19:15
Stateless/dumb React component in Typescript
// stateless/dumb component in React Typescript
import * as React from 'react';
interface IWelcomeProps {
name: string,
}
const Welcome: React.SFC<IWelcomeProps> = ({ name }) => {
return <h1>Hello, {name}</h1>;
}
@jbutko
jbutko / nodejs-upgrade.md
Last active January 30, 2018 10:05
NodeJS upgrade

On Windows download latest "Windows Installer (.msi)" from http://nodejs.org/download/ and install same directory , thats all...

After complete the installation above, the NodeJS and NPM will be upgraded to the latest one and then you can cleanup the package as normal as:

npm cache clean
npm update -g

You can always check the version with following command:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>
@jbutko
jbutko / router.js
Last active August 30, 2017 06:42
React native nested routing with splash screen
// via https://github.com/react-community/react-navigation/issues/156#issuecomment-309263670
import React, { Component } from 'react';
import {
Alert,
AppRegistry,
Button,
StyleSheet,
Text,
View,
@jbutko
jbutko / svn-commands.MD
Last active September 27, 2017 11:00
SVN Commands and Git to SVN mappings
@jbutko
jbutko / site.conf
Last active June 26, 2017 11:33
Nginx: Restrict web access with basic auth
sudo apt-get install apache2-utils
# assign password to "customuser" user
sudo htpasswd -c /etc/nginx/.htpasswd customuser
# edit nginx conf usually located in /etc/nginx/sites-available/default or /etc/nginx/sites-available/customsite.com.conf
sudo nano /etc/nginx/sites-available/default
location / {
...
@jbutko
jbutko / gist:5f273d583f2d0bc287cea645601dcc9b
Created June 9, 2017 08:43
Nginx: Forward socket requests runing behind proxy
# websocket connections need routing to the real-time-sharelatex service,
# running at localhost:3026 by default.
location /socket.io {
proxy_pass http://localhost:3026;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_x_forwarded_host;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;