Skip to content

Instantly share code, notes, and snippets.

View wonsuc's full-sized avatar

Jason Yoo (Wonsuc Yoo) wonsuc

  • pwdr
  • Seoul, South Korea
View GitHub Profile
@evantoli
evantoli / GitConfigHttpProxy.md
Last active May 11, 2024 07:51
Configure Git to use a proxy

Configure Git to use a proxy

In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

@nesquena
nesquena / Contact.java
Last active January 15, 2023 13:03 — forked from rogerhu/Contact.java
Endless Scrolling with RecyclerVIew
package codepath.com.recyclerviewfun;
import java.util.ArrayList;
import java.util.List;
public class Contact {
private String mName;
private boolean mOnline;
public Contact(String name, boolean online) {
@laoyur
laoyur / BaseActivity.java
Last active October 23, 2019 13:40
hide keyboard on touching outside of EditText.
//author: laoyur
//inspired of http://stackoverflow.com/a/31021154
package com.laoyur.test;
import java.util.List;
import android.app.Activity;
import android.content.Context;
import android.graphics.Rect;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
@leblancmeneses
leblancmeneses / bolt-rules-throttle.json
Last active April 4, 2017 13:23 — forked from katowulf/rules.json
throttle messages to no more than one every 5,000 milliseconds, see http://jsfiddle.net/firebase/VBmA5/
type SharedWithInviteRequest {
........
createdDate: RateLimiting
}
// in order to write a message, I must first make an entry in users/${uid}/rate_limiting/{feature} is Number
// additionally, that message must be within 500ms of now, which means I can't
// just re-use the same one over and over, thus, we've effectively required messages
// to be 5 seconds apart
type RateLimiting extends Number {
@unicodeveloper
unicodeveloper / systemjs.config.js
Last active November 20, 2023 05:41
SystemJS config file
/**
* System configuration
*/
(function (global) {
System.config({
paths: {
// paths serve as alias
'npm:': 'node_modules/'
},
// map tells the System loader where to look for things
@somecuitears
somecuitears / Gradle SpringMVC.md
Last active January 27, 2020 16:05
Spring MVC from Gradle in IntelliJ

Creating Gradle Project

  1. Create New Project

  2. Select Java and Web from the Option

  3. You will be asked to provide GroupID and ArtifactID

  • GroupID: it will identify your project uniquely across all projects. (E.g. com.project.model | com.project.plugins)
@Atrix1987
Atrix1987 / firebase_function_feed.js
Created April 23, 2017 09:19
Firebase Function snippet for populating a user feed
exports.updateFeed = functions.database.ref('/stories/{userId}/{storyId}').onWrite(event => {
const userId = event.params.userId;
const storyId = event.params.storyId;
let followersRef = admin.database().ref('/followers/'+userId);
if(!event.data.val()){
//post was deleted
followersRef.once("value", function(snap) {
snap.forEach(function(childSnapshot) {
let followerId = childSnapshot.key;
@jthegedus
jthegedus / CF4F-express|functionsES6|index-03.js
Last active March 4, 2019 06:32
Cloud Functions for Firebase - Express example 3/3 - using CORS and automatically appending a trailing slash
const functions = require("firebase-functions")
const cors = require("cors")
const express = require("express")
/* Express with CORS & automatic trailing '/' solution */
const app3 = express()
app3.use(cors({ origin: true }))
app3.get("*", (request, response) => {
response.send(
"Hello from Express on Firebase with CORS! No trailing '/' required!"
@JoeRoddy
JoeRoddy / FirebaseToFirestore.js
Created October 18, 2017 16:19
Convert Firebase Database JSON to Firestore Collections
var db = firebase.firestore();
var content = require("./sourceData.json");
content &&
Object.keys(content).forEach(contentKey => {
const nestedContent = content[contentKey];
if (typeof nestedContent === "object") {
Object.keys(nestedContent).forEach(docTitle => {
firebase
.firestore()
#if UNITY_EDITOR
using System.Reflection;
using UnityEngine;
using UnityEditor;
public class FontSwitcher : EditorWindow
{
[MenuItem("Font/Show Window")]
public static void ShowFontWindow()
{