Skip to content

Instantly share code, notes, and snippets.

View TeemuKoivisto's full-sized avatar

Teemu Koivisto TeemuKoivisto

View GitHub Profile
@TeemuKoivisto
TeemuKoivisto / .htaccess
Created May 28, 2017 13:40
users htaccess
RewriteEngine On
# tsekkaa onko polku jo turvattu eli https:n ylitse
RewriteCond %{HTTPS} !=on
# jos ei niin uudelleen ohjaa https-polkuun R=redirect L=last eli lopettaa suorittamisen tähän sääntöön
RewriteRule ^/?(.*) https://teekoivi.users.cs.helsinki.fi/$1 [R,L]
# polku on nyt https:ssä joten voimme proxata sen taustalla pyörivälle node-prosessille
@TeemuKoivisto
TeemuKoivisto / go-helloworld-guide.md
Last active May 29, 2017 10:35
Guide to starting up a Go project

How to start a Go project on Mac OS and deploy it to Heroku

What you need:

  1. Travis account (just log in with your GitHub credentials to create one)
  2. Heroku account
  3. Heroku CLI (brew install heroku)
  4. Travis CLI (gem install travis)

Let's start:

@TeemuKoivisto
TeemuKoivisto / travis-s3-guide.md
Last active May 27, 2017 19:54
Guide to hosting static website to AWS S3

How to host a website on S3

S3 is a cheap way to host static files and pretty easy too (when you know how to do it)

What you need to have in order to do it:

  1. AWS account, you can get one through GitHub education > AWS education to get free credit
  2. Travis account (pretty straightforward, just log in with your GitHub account to create it)
  3. 10 minutes

Okey, you're all set. Let's go.

@TeemuKoivisto
TeemuKoivisto / kirjanpito.md
Last active May 26, 2017 23:29
tuntikirjanpito-react-2017
  • 8.5 ma 4h projektin bootstrappaus create-react-appilla + sw-precachella
  • 10.5 ke 4h redux-saga
  • 12.5 pe 7h redux immutable setup ja opiskelua
  • 13.5 la 9h react-router v4 opiskelua ym
  • 14.5 su 9h service worker opiskelua, react bootstrap, font-awesome
  • 27.5 su 2h refresh ikonin säätämistä + react-router
@TeemuKoivisto
TeemuKoivisto / typescript.md
Last active April 22, 2017 15:11
How to create a simple TypeScript app that is compiled into frontend library

Beginning

A short tutorial on how to create a basic TypeScript app for a game or another project targeted on frontend.

1. Setting up the project

Create a new folder for your project and cd there and type npm init to create package.json. Writer whatever you want there or just hit enter to each and then let's install typescript: npm i -S typescript. We could install it also globally for some ease of use BUT to me installing global dependencies are annoying so for now let's withold from doing so.

Instead let's add tsconfig.json manually to the root of our folder. This would be created with tsc --init but since we are now very stupid we'll do it manually. Copy & paste this inside of it:

Installing Docker on Windows

Follow the basic setup as in the Docker website. For me I had to download the Docker toolchain from here 🔗.

After that you should have docker installed and the Docker terminal ready to be opened from your desktop.

I followed the instructions from here https://nodejs.org/en/docs/guides/nodejs-docker-webapp/ to create my first Docker container with Node.js. Here's the short and sweet if you want just to copy and paste to see if it works: NOTE! On Windows or MacOS machines you cannot go straight to the localhost:49160 to see the app working. As explained here moby/moby#15740 they cannot run the Docker container natively so the port is actually the one on the VirtualBox so for me worked just write docker-machine ip default and whatever the ip from that is your container's ip. (my app was on http://192.168.99.100:49160/)

@TeemuKoivisto
TeemuKoivisto / users-ohjeet.md
Last active March 27, 2019 14:36
Noden asennus users-palvelimelle

Node serverin asennus users-palvelimelle

Tai samaa ohjetta hivenen modifioimalla minkä tahansa muun palvelimen johon ei tarvita sudo-oikeuksia; RoRin, Djangon tai vaikka Go:n. Huomioitavana on vain users-palvelimen vanha käyttöjärjestelmä: Ubuntu 10.04 joka ei välttämättä kaikkea pyöritä ilman ainakaan ongelmia.

  1. Ota ssh-yhteys users-palvelimelle esim. ssh TUNNUS@users.cs.helsinki.fi jossa TUNNUS on ad-tunnuksesi
  2. Suorita wanna-htdocs jos sinulle ei ole jo Apachee asennettuna ja htdocs kansiota
  3. Luo Apachen konfiguraatio tiedosto .htaccess touch ~/htdocs/.htaccess
  4. Lisää siihen rivit:
RewriteEngine On