Skip to content

Instantly share code, notes, and snippets.

View yomybaby's full-sized avatar

Jong Eun Lee yomybaby

View GitHub Profile
@gaearon
gaearon / 00-README-NEXT-SPA.md
Last active July 19, 2024 06:35
Next.js SPA example with dynamic client-only routing and static hosting

Next.js client-only SPA example

Made this example to show how to use Next.js router for a 100% SPA (no JS server) app.

You use Next.js router like normally, but don't define getStaticProps and such. Instead you do client-only fetching with swr, react-query, or similar methods.

You can generate HTML fallback for the page if there's something meaningful to show before you "know" the params. (Remember, HTML is static, so it can't respond to dynamic query. But it can be different per route.)

Don't like Next? Here's how to do the same in Gatsby.

# Read more about setting it up
# https://medium.com/@ljmocic/deploying-react-application-to-aws-s3-using-github-actions-85addacaeace
on:
push:
tags:
- '*'
jobs:
build:
@redism
redism / kr_won_to_backquote.sh
Created April 26, 2017 16:20
macOS Sierra에서 원화(₩) 대신 백 쿼트(`) 입력하기
#!/bin/bash
if [ -f ~/Library/KeyBindings/DefaultkeyBinding.dict ]; then
echo "~/Library/KeyBindings/DefaultkeyBinding.dict already exists"
exit -1
fi
mkdir -p ~/Library/KeyBindings
cat << EOF > ~/Library/KeyBindings/DefaultkeyBinding.dict
{
"₩" = ("insertText:", "\`");
@gimdongwoo
gimdongwoo / GMapsSingle.html
Last active May 24, 2016 22:56
Google Maps in Titanium Webview
<!-- app/assets/html/GMapsSingle.html -->
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>GMapsSingle</title>
<style>
html, body {
height: 1920px;
@nuno
nuno / README.md
Last active May 31, 2020 06:21 — forked from grantges/README.md
Titanium TSS for Transparent NavigationBar / Shadow on iOS

Creating a transparent NavigationBar using Titanium Style Sheets

Appcelerator Titanium offers many ways to style the navigation bar for iOS apps, from changing out the title view all together, or just using simple colors. However, one of the most frequent requests I hear is how to make a truly transparent NavigationBar. This tutorial will cover that.

Getting started

Lets start with a pretty simple window style in the app.tss. This will ensure that the window style is applied globally.

Note: This can be used in a specific controller *.tss file if you only want this effect on a particular window.

@kosso
kosso / TiUIAttributedStringProxy.m
Last active August 15, 2016 05:23
Hacked version of TiUIAttributedStringProxy.m to try to add support for ParagraphStyle and Attachment attributed strings.
/**
* Appcelerator Titanium Mobile
* Copyright (c) 2015 by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*/
#if defined (USE_TI_UIATTRIBUTEDSTRING) || defined(USE_TI_UIIOSATTRIBUTEDSTRING)
#import "TiUIAttributedStringProxy.h"
#import "TiProxy.h"
#import "TiUtils.h"
@leommoore
leommoore / mongodb_3.2.x_replica_sets_on_aws_ec2.md
Last active March 15, 2022 22:28
MongoDB 3.2.x Replica Sets on AWS EC2

#MongoDB 3.2.x Replica Sets on AWS EC2 A MongoDB replica set provides a mechanism to allow for a reliable database services. The basic replica set consists of three servers, a primary, a secondary and an arbitrator. The primary and secondary both hold a copy of the data. The arbitrator is normally a low spec server which just monitors the other servers and help with the failover process. In production, there can be more than three servers.

To setup mongo as a replica set on Amazon Web Services EC2 you need to first setup a security group with ssh on port 22 and mongodb on port 27017. You then need to create three servers. Select Ubuntu 14.04 LTS x64 and a micro (or bigger depending on your database size, ideally you should have enough memory to match your database size) instance for the primary and secondary and a nano instance for the arbitrator.

##Adjust the File System on each Server The operating system by default will update the last access time on a file. In a high data throughput database application

/**
* Sample React Native App
* https://github.com/facebook/react-native
*/
'use strict';
const React = require('react-native');
const FBSDKCore = require('react-native-fbsdkcore');
const FBSDKLogin = require('react-native-fbsdklogin');
@rhossi
rhossi / s3upload.js
Created July 30, 2015 18:22
Uploading files to S3 validating ContentMD5 using AWS SDK for Node.js
var aws = require('aws-sdk'),
fs = require('fs'),
crypt = require("crypto");
function getMD5HashFromFile(file){
var hash = crypt.createHash("md5")
.update(file)
.digest("base64");
return hash;
}
@mvaneijgen
mvaneijgen / Screencast Setup.scpt
Created March 9, 2015 14:10
Change screen resolution using Applescript works on 10.10 non-rentia macbook
-- Launch "System Preferences", open the "Displays" options and change to the "Display" tab
tell application "System Preferences"
activate
set the current pane to pane id "com.apple.preference.displays"
reveal anchor "displaysDisplayTab" of pane id "com.apple.preference.displays"
end tell
local indexToUse
-- Now lets make the necessary changes