Skip to content

Instantly share code, notes, and snippets.

View RustingSword's full-sized avatar
🤦‍♂️

RustingSword

🤦‍♂️
View GitHub Profile
#!/bin/bash
song=$(echo -n `mocp -Q %song 2> /dev/null`)
artist=$(echo -n `mocp -Q %artist 2> /dev/null`)
if [[ "$song" != "" ]]
then
if [[ "$artist" != "" ]]
then
echo -n "\${color white} Now Playing: \${color green} $song - $artist"
else
echo -n "\${color white} Now Playing: \${color green} $song"
#!/bin/bash
from=$1
shift
notify-send -i "/home/orz/.scripts/notify.png" -- "New Message" "From: $from \n$*" 2 > /dev/null
aplay -q "/home/orz/.scripts/message.wav" &
#!/bin/bash
last=0
cur=0
while [ : ]
do
mailcheck | grep new 2>&1 >/dev/null
if [ $? -eq 0 ]
then
cur=$(mailcheck | awk 'BEGIN {sum=0} ; $4~/new/ {sum=sum+1}; END {print sum}')
if [ $cur -ne $last ]
\documentclass{ctexart}
\usepackage{graphicx}
\usepackage{caption}
\begin{document}
\begin{figure*}[h]
\begin{minipage}[t]{0.45\linewidth}
\centering
\includegraphics[width=1.75\linewidth]{BytesDF.png}
%\caption[loftitle]{blabla}
\end{minipage}
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX_NUM 100
#define MAX_LEN 20
char strings[MAX_NUM][MAX_LEN + 1];
char smallest[MAX_LEN+1], largest[MAX_LEN+1];
@RustingSword
RustingSword / gist:4054060
Created November 11, 2012 07:19
光棍节书单

当当原价五折无满减,京东、亚马逊折后300-150

所列价格为网站标价,非原价


京东:

The Klingon Dictionary: English/Klingon, Klingon/English (Star Trek) 74.30元
@RustingSword
RustingSword / _vimperatorrc.vim
Created November 20, 2012 05:08
vimperator config file
"20091020
let mapleader=";"
" " " 映射
" " 页面操作
" 一次移动5行
noremap j 5j
noremap k 5k
" 上下滚动
@RustingSword
RustingSword / hosts.md
Created November 26, 2012 13:20
Hosts for Google Services

via http://shen0956.com/?p=1523

173.194.72.82 www.google.com.hk

74.125.31.189 mail.google.com
74.125.31.189 plus.google.com
74.125.31.189 adsense.google.com
74.125.31.189 analytics.google.com
74.125.31.189 drive.google.com

74.125.31.189 translate.google.cn

@RustingSword
RustingSword / SimpleTimeTracker.ahk
Last active January 25, 2024 19:07
A simple time tracker implemented in AutoHotkey, modified from http://www.autohotkey.com/board/topic/37998-tiny-computer-usage-tracker/
; ticker - A Simple Time Tracker
; track your time usage on a daily basis
#InstallKeybdHook
#InstallMouseHook
Menu, Tray, Icon, %A_WinDir%\system32\shell32.dll, 44
Menu, Tray, Tip, ticker - A Simple Time Tracker`nPress right control to see details
SetWorkingDir, C:\Users\%A_UserName%\Documents
SetTimer, CheckTime, 60000 ; updates every 1 minute
@RustingSword
RustingSword / extraction.py
Last active January 16, 2023 16:38
stay point extraction from dataset provided by GeoLife project
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# extract stay points from a GPS log file
# implementation of algorithm in
# [1] Q. Li, Y. Zheng, X. Xie, Y. Chen, W. Liu, and W.-Y. Ma, "Mining user similarity based on location history", in Proceedings of the 16th ACM SIGSPATIAL international conference on Advances in geographic information systems, New York, NY, USA, 2008, pp. 34:1--34:10.
import time
import os
import sys