Skip to content

Instantly share code, notes, and snippets.

@roharon
roharon / YTD Strava Metrics
Last active September 16, 2023 00:40
My Health Check
Running 447.22 km ███████████████████ 9.57/h
Swimming 0.00 km ░░░░░░░░░░░░░░░░░░░ 0.00/h
Cycling 0.00 km ░░░░░░░░░░░░░░░░░░░ 0.00/h
Last month 68.63 km 16 achievements 7:1h
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
@roharon
roharon / index.html
Last active August 1, 2021 09:27
단축 URL index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>단축URL 생성기</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.3/css/bulma.min.css">
<style>
@roharon
roharon / tistory-codeblock-1.3x.css
Last active January 5, 2021 13:43
tistory-codeblock-1.3x
pre > code {
font-size: 1.3em;
}
@roharon
roharon / gist:23f287bed7c3833fae14deb1fc6e36f2
Last active October 27, 2020 11:52
sa-admin-create.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: sa-admin
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: admin-all-cluster
subjects:
Java 1 hr 49 mins ██████▊░░░░░░░░░░░░░░ 32.4%
YAML 1 hr 40 mins ██████▎░░░░░░░░░░░░░░ 29.8%
Python 1 hr 36 mins █████▉░░░░░░░░░░░░░░░ 28.5%
Other 15 mins ▉░░░░░░░░░░░░░░░░░░░░ 4.7%
Groovy 13 mins ▊░░░░░░░░░░░░░░░░░░░░ 4.0%
@Api(tags = {"1. Store"})
@Validated
@RestController
@AllArgsConstructor
@RequestMapping(value = "/api/v1/store")
public class StoreController {
private static final Logger LOGGER = LogManager.getLogger(StoreController.class);
private StoreRepository storeRepository;
private final int RADIUS = 1000;
package com.aaronroh.gmoney.domain.store;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
package com.aaronroh.gmoney.domain.store;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
public interface StoreRepository extends JpaRepository<Store, Long> {
@roharon
roharon / 15954.cpp
Created February 11, 2020 04:56
g++ array[2] windows, linux
#include <iostream>
#include <cmath>
using namespace std;
typedef long double ld;
ld get_m(int K, int idx, int array[]){
ld m = 0;
for(int i =idx; i<idx+K; i++){