Skip to content

Instantly share code, notes, and snippets.

View joojis's full-sized avatar

JinGyeong Jeong joojis

View GitHub Profile
@joojis
joojis / hook.tsx
Created November 1, 2023 15:07
리액트 훅을 프로퍼티로 받아 컴포넌트로 바꾸는 컴포넌트
export const Hook = <
F extends (...args: [...any]) => any,
Args extends Parameters<F>,
Returns extends ReturnType<F>,
CallableChild extends (returns: Returns) => ReactElement
>({
f,
args,
children,
}: Args extends []
@joojis
joojis / reset_all_commit_author.md
Created February 23, 2018 05:39
Reset all commit author

Rebase

git rebase -i --root

Repeat N times

git --amend --no-edit --reset-author &amp;&amp; git rebase --continue
@joojis
joojis / elapsed_time_measure.rs
Last active January 23, 2018 02:17
Rust - elapsed time measure
mod test {
use std::time::Instant;
// ...
fn my_function() {
let now = Instant::now();
// do something here
let elapsed = now.elapsed();
'use strict';
let conversion = require('phantom-html-to-pdf')();
let fs = require('fs');
let jsdom = require('jsdom');
let domString = fs.readFileSync('my.html');
let selectComponent = function (url, selector, cb) {
jsdom.env(
@joojis
joojis / gist:1895737fbcd694cc53af
Created October 18, 2015 17:07
Pointer-Lock-for-Trackpoint-Wheel.sh
#!/bin/sh
ID=`xinput list --id-only "ThinkPad Keyboard"` || (echo "Failed to find ThinkPad Keyboard"; exit 1;)
echo "Found ThinkPad Keyboard ID: $ID"
echo "Setting Evdev Wheel Emulation ... ";
# Originally 0
EVDEV_WHEEL_EMULATION=1
xinput set-prop $ID "Evdev Wheel Emulation" $EVDEV_WHEEL_EMULATION
ID=`xinput list --id-only "pointer:Lite-On Technology Corp. ThinkPad USB Keyboard with TrackPoint"`
xinput set-float-prop $ID "Device Accel Velocity Scaling" 500
xset mouse 15 15
#!/bin/sh
dbus-monitor "interface='com.ubuntu.Upstart0_6',member='EmitEvent'" | (
while true; do
read X;
if [ "$X" = "string \"desktop-unlock\"" ]; then
xmodmap $HOME/.Xmodmap;
echo 1 $X;
else
echo 0 $X;
@joojis
joojis / gist:583dd08948800eb71b77
Created March 11, 2015 14:51
functional-snail-sort.js
Array.prototype.wrap = function (first, last) {
return [first].concat(this).concat([last || first]);
};
Array.prototype.fill = function (filler) {
return this.map(function () {
return filler;
});
};
var filledArray = function (filler, length) {
return range(1, length).fill(filler);
@joojis
joojis / .Xmodmap
Created January 3, 2015 00:58
한영키
keycode 105 = Hangul_Hanja NoSymbol Hangul_Hanja
keycode 108 = Hangul NoSymbol Hangul
keycode 130 = Hangul NoSymbol Hangul
keycode 131 = Hangul_Hanja NoSymbol Hangul_Hanja
@joojis
joojis / gist:8b1825bde6808beb58c2
Created December 17, 2014 08:47
Trackpoint Configuration
http://www.thinkwiki.org/wiki/How_to_configure_the_TrackPoint