Skip to content

Instantly share code, notes, and snippets.

View somidad's full-sized avatar

Seokseong Jeon somidad

  • Samsung Electronics
  • Korea, Republic Of
View GitHub Profile
<head>
<script src="js/jquery-3.1.0.min.js"></script>
<script src="js/spreadcell.js"></script>
</head>
<body>
<div id="mlb">
Loading content...
</div>
<script>
// prepare a callback funciton
@somidad
somidad / redmine.service
Last active October 21, 2016 16:09
systemd scripts for Puma (for Redmine)
# /lib/systemd/system/redmine.service
[Unit]
Description=Redmine Puma server
After=network.target
[Service]
Type=simple
User=<username>
import pandas as pd
pd.set_option('max_rows', 999,
'expand_frame_repr', False)
def parse_reg(h):
txt = ''
if not h & (1 << 0):
return '-'
if not h & (1 << 1):
txt += 'NO-IBSS '
@somidad
somidad / clear-printer-queue.cmd
Created November 30, 2016 18:42
Clear printer queue (for Windows 10)
net stop spooler
del %systemroot%\System32\spool\printers\* /Q /F /S
net start spooler
@somidad
somidad / clear-youtube-watch-later.js
Created November 30, 2016 18:43
Clear Youtube watch later list
/* copy and paste below in web browser console
* source: https://www.reddit.com/r/youtube/comments/2jfdzf/how_to_remove_all_videos_from_watch_later/cof5cbb */
function d(){
var el = document.getElementsByClassName('pl-video-edit-remove');
if (el.length > 0) {
el[el.length-1].click();
setTimeout(d,300);
}
}
function gmail_schedule_delete() {
var current = new Date();
var onedaymilli = 24 * 60 * 60 * 1000;
Logger.log("Current date: " + current);
var label_common = "(schedule delete)/after ";
var sublabels = [["1 week", 7],
["2 weeks", 14],
["1 month", 30],
["3 months", 90],
@somidad
somidad / decodeurl.py
Created January 20, 2017 13:21
Rename URL encoded file name
#!/usr/bin/env python3
import urllib.parse as parse
import os
def print_usage():
print('Usage: decodeurl.py encodedfilename')
def main(fname):
if not os.path.isabs(fname):
@somidad
somidad / sbin.dhclient
Created February 8, 2017 04:03
apparmor for /sbin/dhclient
# vim:syntax=apparmor
# Last Modified: Fri Jul 17 11:46:19 2009
# Author: Jamie Strandboge <jamie@canonical.com>
#include <tunables/global>
/sbin/dhclient {
#include <abstractions/base>
#include <abstractions/nameservice>
capability net_bind_service,
@somidad
somidad / gist:36fc741143d65e247d571ab391cb98f9
Created February 10, 2017 08:41
/etc/dbus-1/system.d/NetworkManager.conf:
<!DOCTYPE busconfig PUBLIC
"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
<policy user="root">
<allow own="org.freedesktop.NetworkManager"/>
<allow send_destination="org.freedesktop.NetworkManager"/>
<allow send_interface="org.freedesktop.NetworkManager"/>
<allow own="org.freedesktop.NetworkManager.PPP"/>
@somidad
somidad / git-root.sh
Last active April 10, 2017 16:28
A shortcut to git root
# This git alias allows you to move
# to the root of a local git repository
# (if you are in the repo)
# define a shortcut to git root
git config --global alias.root 'rev-parse --show-toplevel'
# Usage: go to the git root
cd $(git root)
# Usage: add all under the git root