Skip to content

Instantly share code, notes, and snippets.

View lirenyeo's full-sized avatar
🏇
Keep going!

Liren lirenyeo

🏇
Keep going!
View GitHub Profile
# All translation key-value pair must be have String datatype as key
require 'fileutils'
dir = '/Users/liren/Desktop'
SOURCE_LANG = 'EN'
LANGS = ['ID', 'MS', 'TH', 'ZH']
def translate(file_path, lang)
lines = IO.readlines(file_path).map do |line|
import React from 'react'
class App extends React.Component {
state = {
input: '', // The actual typed text
hasImage: false, // The checkbox state to indicate whether there is an image
}
handleInput = e => {
// Uncheck image whenever typed text length is 15 or less, else it remains in the original state
// A perhaps more readable code would be:

Final Assessment

Book Your Timing (need spreadsheet URL here for booking)

How it works?

1. Build a full-stack web application with Python Flask server and ReactJS client.

These are some examples you can work on:

  • Trip Advisor Clone
  • Pinterest Clone
<html lang="en">
<head>
<title>Day 2 Exercise</title>
<!-- Link your CSS to this file -->
</head>
<body>
<!-- RULE 1: NO MODIFICATION ON HTML -->
<!-- RULE 2: NO INLINE-STYLING -->

Google Places APIs

/maps/api/place/autocomplete

  • Takes input string and return multiple matching addresses with place_id
  • Can use lat,lng location + radius to create bias result
  • result is different than /textsearch
  • ex: no result for ไลฟ์ สุทธิสาร

/maps/api/place/queryautocomplete

  • Can process request like 'cafe near me'
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDXVp7MwDPWKNM/O2kBN0+tOvIZG3aIMJnJ7vZcq2ANJy0zCNs7JbYAC7/LKN9L3vVT2E/PEZuIufVeIaq67DtuyuBxa+Dt9o9f91VVnScAJdS5NYMU2BN7whprzpVU+d0Dem9PONV+eSCn3DmexQEQrow2lRk3Ls7oUmB0sNtxeruVPuDNxyyqCCO8ajd60rro0R/YQZ5hcwqhXqaHZejXdqL4UJ4Xk5BIanfwPxoteHXCuPgvseMQ7P/1uS/6ryG8MZPxvBkBFAuy0EbKOwDNDOJEpawLn+iKAQjakmne774GG7bE8VQrPQuNfku2FeJiDzMNPoZ36ucJz8+bUmbz [email protected]

CSS Exercise (Ninja Joe Profile Page)

  1. Download the HTML file from here: https://bit.ly/2FwrMCN

  2. Style the site to make it look like this:

Desktop

Desktop Screenshot

@lirenyeo
lirenyeo / export.rb
Created December 19, 2020 06:49 — forked from KevinSia/export.rb
require 'prawn'
arr = HallSession
.joins(:check_in_sessions, :hall)
.group('check_in_sessions.hall_session_id, auditorium_halls.name, hall_sessions.start_at, hall_sessions.end_at, hall_sessions.id')
.select('auditorium_halls.name as hall_name, hall_sessions.start_at, hall_sessions.end_at, COUNT(*) as c')
.order('hall_name, start_at, end_at')
.map do |ci|
[
@lirenyeo
lirenyeo / create_vimeo_api.md
Last active May 19, 2021 15:14
[3 minutes] Creating Vimeo API Key

In order for developers to build feature for users to upload videos directly to Vimeo, account owner needs to create a 'developer app' that comes with Personal Access Token and Secret Keys (we usually just call all these "API Keys"), and pass that to programmers.

Vimeo also requires owner to specifically request for permission to do direct video upload, this request might take up to 5 days for approval, so please prepare it as early as possible.

Note: For direct video upload, the vimeo account needs to be of Pro, Business, Premium or Enterprise tier

Steps

  1. Visit https://developer.vimeo.com/apps/new
  2. Click 'Create An App'
  3. Fill in App name and description