Skip to content

Instantly share code, notes, and snippets.

View firejune's full-sized avatar
🔥
Working from home

Joon Kyoung firejune

🔥
Working from home
View GitHub Profile
@firejune
firejune / useKeepScrollPosition.ts
Created November 13, 2021 12:24
Scroll position save and restoration for the given url
import React, { useRef, useEffect } from 'react'
import { useRouter } from 'next/router'
// Save the scroll position for the given url
function saveScrollPosition(url: string, element: HTMLElement, savePosition: (url: string, pos: number) => void) {
savePosition(url, element.scrollTop)
}
// Restore the scroll position for the given url is possible
function restoreScrollPosition(
@firejune
firejune / free_ports.sh
Created October 31, 2021 12:18 — forked from Stenudd/free_ports.sh
Free ports 80 and 443 on Synology NAS
#! /bin/bash
# Save this script in one of your shares and schedule it to run as root at boot
# through Control Panel -> Task Scheduler
# DSM upgrades will reset these changes, which is why we schedule them to happen automatically
# Set the variables below if you want to customise the ports which DSM will listen on instead
# NOTE: These ports are used for some services, e.g. Photo Station
HTTP_PORT=81
HTTPS_PORT=444
@firejune
firejune / gist:6f8a19d3370b2f1877aed58231cf9989
Created January 16, 2021 07:08 — forked from digitaljhelms/gist:4287848
Git/GitHub branching standards & conventions

Branching

Quick Legend

Description, Instructions, Notes
Instance Branch
@firejune
firejune / package.json
Last active November 30, 2016 13:06
Psyclone Studio - Package
{
"name": "psyclone-studio",
"productName": "Psyclone",
"version": "0.6.4",
"description": "Automated Dynamic Testing Solution",
"license": "MIT",
"homepage": "https://git.rsupport.com/psyclone/studio",
"main": "main.js",
"bugs": {
"url": "https://git.rsupport.com/psyclone/studio/issues"
@firejune
firejune / Workspace.jsx
Last active November 28, 2016 11:25
Psyclone Studio - Workspace
import React, { Component, PropTypes } from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import Immutable, { Map, List } from 'immutable';
import { Actions as DeviceActions } from '../redux/Device';
import { Actions as ExecuteActions } from '../redux/Execute';
import { Actions as ProjectActions } from '../redux/Project';
import { Actions as WorkspaceActions } from '../redux/Workspace';
import { Actions as TerminalActions } from '../redux/Terminal';
@firejune
firejune / # opencv - 2016-10-11_20-48-40.txt
Created October 11, 2016 11:53
opencv (homebrew/science/opencv) on macOS 10.12 - Homebrew build logs
Homebrew build logs for homebrew/science/opencv on macOS 10.12
Build date: 2016-10-11 20:48:40
var MT32Module=(function(){var Module;if(!Module)Module=(typeof Module!=="undefined"?Module:null)||{};var moduleOverrides={};for(var key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof require==="function";var ENVIRONMENT_IS_WEB=typeof window==="object";var ENVIRONMENT_IS_WORKER=typeof importScripts==="function";var ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE){if(!Module["print"])Module["print"]=function print(x){process["stdout"].write(x+"\n")};if(!Module["printErr"])Module["printErr"]=function printErr(x){process["stderr"].write(x+"\n")};var nodeFS=require("fs");var nodePath=require("path");Module["read"]=function read(filename,binary){filename=nodePath["normalize"](filename);var ret=nodeFS["readFileSync"](filename);if(!ret&&filename!=nodePath["resolve"](filename)){filename=path.join(__dirname,"..","src",filename);ret=nodeFS["readFileSync"](filename)}if(ret&
@firejune
firejune / fully.js
Created August 18, 2016 05:43
Dynamic background displayer
window.fully = (function(win, doc) {
function viewer(options) {
win._cb = function(obj) {
var image = doc.getElementById(options.elementId);
image.src = '//www.bing.com' + obj.query.results.json.images.url;
if (image.complete) {
addClassName(image, 'active', true);
} else {
image.onload = function() {
addClassName(image, 'active', true);
@firejune
firejune / is_utf8.php
Created July 4, 2016 08:21 — forked from GeHou/is_utf8.php
php:is_utf8
<?php
function is_utf8($str) {
$temp_str = @iconv('utf-8', 'utf-8', $str);
if ($str === $temp_str) {
return 'utf8';
} else {
return 'gbk';
}
@firejune
firejune / compareText.php
Created June 29, 2016 03:27
Compare Two Strings
<?
function compareText($str1, $str2) {
$str1 = split(" ", $str1);
$str2 = split(" ", $str2);
$count = 0;
for ($i = 0; $i < sizeof($str1); $i++) {
for ($j = 0; $j < sizeof($str2); $j++) {
if ($str1[$i] == $str2[$j]) $count++;