Skip to content

Instantly share code, notes, and snippets.

View jnozsc's full-sized avatar
🍎
Working

jnozsc

🍎
Working
  • California
View GitHub Profile
@jnozsc
jnozsc / issue_1088_fix.rb
Created March 6, 2013 19:19
This program can fix Octopress issue #1088 In fact, it is not a bug in Octopress. It is introducted by 3rd party migration tool. However, I have forgotten which tool causes this issue. So I write this program to help others who meet the same issue
# encoding: utf-8
# description: This program can fix Octopress issue #1088
# In fact, it is not a bug in Octopress.
# It is introducted by 3rd party migration tool.
# However, I have forgotten which tool causes this issue.
# So I write this program to help others who meet the same issue
# usage: in your Terminal.app, type the following line:
# ruby issue_1088_fix.rb [/your/octopress/path/]
# e.g: ruby issue_1088_fix.rb ~/octopress/source/_posts/
@jnozsc
jnozsc / program.rb
Last active December 20, 2015 17:18
# encoding: UTF-8
require 'csv'
source_file = "program.csv"
result_file = "result.csv"
CSV.open(result_file,"ab") do |csv|
csv<<['DBN',
'PROGRAM',
#!/bin/bash
#Linux Spotify Ad Mute v2
#Put this script in the directory the "spotify" binary is in (e.g. /usr/share/spotify).
#To open Spotify, run it instead of the "spotify" binary.
#System sound will be muted as soon as an ad plays
#Find updated versions at: http://pcworldsoftware.kilu.net/files/link_spotify-admute.php and/or https://gist.github.com/pcworld
#On Debian, you need the package "pulseaudio-utils" for the command line util "pactl" which used in this script
#
#Update: For newer 0.8.x versions (x>4; such as 0.8.8), use this script: https://gist.github.com/pcworld/3198763/#comment-813440
@jnozsc
jnozsc / preprocessor_fun.h
Created January 29, 2016 07:44 — forked from aras-p/preprocessor_fun.h
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@jnozsc
jnozsc / mpv.conf
Last active June 26, 2023 04:03
mpv.conf
# place this file in ~/.mpv/
# gpu high profile with even more quality scalers
profile=gpu-hq
scale=ewa_lanczossharp
cscale=ewa_lanczossharp
dscale=mitchell
# color
icc-profile-auto
#!/usr/bin/python
# -*- coding: utf-8 -*-
import argparse
from random import shuffle
GUEST_NAME = [
u'阿仁',
u'sk',
u'lulu',
@jnozsc
jnozsc / hanoi.py
Last active February 28, 2018 03:40
# -*- coding: utf-8 -*-
import argparse
def hanoi(number):
def hanoi_recursion(to_move=[], start=1, intermediate=2, end=3):
if len(to_move) <= 0:
return
elif len(to_move) == 1:
print(u'把 %d 号盘子从第 %d 个塔移动到第 %d 个塔' % (to_move[0], start, end))
@jnozsc
jnozsc / lunch.py
Last active June 14, 2018 04:15
lunch.py
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
import random
candidate = [
'默认鸡排',
'柠檬鸡串',
'奥尔良烤',
'土耳其烤',
@jnozsc
jnozsc / # python - 2018-06-18_13-00-56.txt
Created June 18, 2018 20:57
python on macOS 10.14 - Homebrew build logs
Homebrew build logs for python on macOS 10.14
Build date: 2018-06-18 13:00:56
@jnozsc
jnozsc / killadobe.sh
Created September 25, 2018 03:40 — forked from CyberPunkCodes/killadobe.sh
Mac Bash script to kill Adobe Create Cloud and other processes that Adobe forces on us.
#!/bin/bash
echo "\n\n--- Killing Stupid Adobe Auto Load Crap ---\n\n"
launchctl unload -w /Library/LaunchAgents/com.adobe.AdobeCreativeCloud.plist
launchctl unload -w /Library/LaunchAgents/com.adobe.AAM.Updater-1.0.plist
echo "\n\n--- Done! ---\n\n"