Skip to content

Instantly share code, notes, and snippets.

View devxoul's full-sized avatar
👨‍💻
Always coding

Suyeol Jeon devxoul

👨‍💻
Always coding
View GitHub Profile
@devxoul
devxoul / naver-cafe-chat-left-message.js
Last active August 29, 2015 14:06
네이버 카페에서 내 채팅을 왼쪽 정렬로 보이게 하는 스크립트
document.body.appendChild($('<style>div.my.msg{text-align:left;}</style>'));
@devxoul
devxoul / shout.xoul.kr
Created September 26, 2014 17:05
Nginx configuration for shout.xoul.kr.
server {
listen 80;
server_name shout.xoul.kr;
location / {
proxy_pass http://127.0.0.1:4321;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
@devxoul
devxoul / git-pruneoff
Last active February 4, 2022 10:51
Git Prune Off: Delete merged branches.
#!/bin/bash
# https://gist.githubusercontent.com/devxoul/72adcb880b273a36420d/raw/git-pruneoff
# Delete merged branches.
git branch --merged | awk '{if($1 != "*" && ($1 != "master" || $1 != "main")) print $1}' | xargs git branch -d
@devxoul
devxoul / github-monospace-editor.js
Created October 7, 2014 06:11
GitHub Monospace Editor
// ==UserScript==
// @name GitHub Monospace Editor
// @namespace http://xoul.kr/github-monospace-editor
// @version 0.1.0
// @description Monospace GitHub Editor
// @match github.com/*/*/*
// @copyright 2014, devxoul
// ==/UserScript==
$(document.head).append($('<style>#pull_request_body { font-family: monospace; }</style>'));
@devxoul
devxoul / git-pushme
Last active January 27, 2021 08:02
Git Push Me: Git push current branch to origin.
#!/bin/bash
# https://gist.githubusercontent.com/devxoul/a972ba0db2a25b989887/raw/f62353501becb274eb63c76b83fbcc01250a286d/git-pushme
# git push origin CURRENT_BRANCH
BRANCH=$(git branch --list | awk '{ if ($1 == "*") print $2 }')
while true; do
read -p "Push branch '$BRANCH' to origin? [Y/n] " -n 1 -r
echo

Runtime Version Check

There are several ways to check for new features provided by the Cocoa frameworks at runtime. One is to look for a given new class or method dynamically, and not use it if not there. Another is to use the global variable NSAppKitVersionNumber (or, in Foundation, NSFoundationVersionNumber):

double NSAppKitVersionNumber;
#define NSAppKitVersionNumber10_0 577
#define NSAppKitVersionNumber10_1 620
#define NSAppKitVersionNumber10_2 663
#define NSAppKitVersionNumber10_3 743
@devxoul
devxoul / line-length-linter.sh
Last active August 29, 2015 14:09
Maximum line length limitation linter script.
#!/bin/bash
##
# The MIT License (MIT)
#
# Copyright (c) 2013-2014 Suyeol Jeon (http://xoul.kr)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
@devxoul
devxoul / GitHub3.css
Last active February 4, 2023 00:07
GitHub CSS for MacDown
/*
* GitHub CSS for MacDown
* https://gist.github.com/devxoul/8df5792ce330985a633b
* http://sindresorhus.com/github-markdown-css/
*/
@font-face {
font-family: octicons-link;
src: url(data:font/woff;charset=utf-8;base64,d09GRgABAAAAAAZwABAAAAAACFQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEU0lHAAAGaAAAAAgAAAAIAAAAAUdTVUIAAAZcAAAACgAAAAoAAQAAT1MvMgAAAyQAAABJAAAAYFYEU3RjbWFwAAADcAAAAEUAAACAAJThvmN2dCAAAATkAAAABAAAAAQAAAAAZnBnbQAAA7gAAACyAAABCUM+8IhnYXNwAAAGTAAAABAAAAAQABoAI2dseWYAAAFsAAABPAAAAZwcEq9taGVhZAAAAsgAAAA0AAAANgh4a91oaGVhAAADCAAAABoAAAAkCA8DRGhtdHgAAAL8AAAADAAAAAwGAACfbG9jYQAAAsAAAAAIAAAACABiATBtYXhwAAACqAAAABgAAAAgAA8ASm5hbWUAAAToAAABQgAAAlXu73sOcG9zdAAABiwAAAAeAAAAME3QpOBwcmVwAAAEbAAAAHYAAAB/aFGpk3jaTY6xa8JAGMW/O62BDi0tJLYQincXEypYIiGJjSgHniQ6umTsUEyLm5BV6NDBP8Tpts6F0v+k/0an2i+itHDw3v2+9+DBKTzsJNnWJNTgHEy4BgG3EMI9DCEDOGEXzDADU5hBKMIgNPZqoD3SilVaXZCER3/I7AtxEJLtzzuZfI+VVkprxTlXShWKb3TBecG11rwoNlmmn1P2WYcJczl32etSpKnziC7lQyWe1smVPy/Lt7Kc+0vWY/gAgIIEqAN9we0pwKXreiMasxvabDQMM4riO+qxM2ogwDGOZTXxwxDiycQIcoYF
@devxoul
devxoul / git-tag-semver.sh
Last active November 11, 2019 12:28
Replace git tags to semantic version
#!/bin/bash
# Replace git tags to semantic version
# e.g. v1.0.0 -> 1.0.0
for vtag in $(git tag -l | awk '$0 ~ /^v/')
do
tag=$(echo $vtag | sed -e 's/^v//')
git tag $tag $vtag
git tag -d $vtag
git push origin :refs/tags/v$tag
@devxoul
devxoul / CGFloatLiteral.swift
Created June 29, 2015 09:01
CGFloatLiteral
The MIT License (MIT)
Copyright (c) 2015 Suyeol Jeon
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: