Skip to content

Instantly share code, notes, and snippets.

(defun vulpea-project-p ()
"Return non-nil if current buffer has any todo entry.
TODO entries marked as done are ignored, meaning the this
function returns nil if current buffer contains only completed
tasks."
(seq-find ; (3)
(lambda (type)
(eq type 'todo))
(org-element-map ; (2)
@dustincys
dustincys / Mapping.R
Created December 10, 2021 15:26
Mapping cell label to reference
#'--------------------------------------------------------------
#' filename : Mapping.R
#' Date : 2021-08-08
#' contributor : Yanshuo Chu
#' function: Mapping
#'--------------------------------------------------------------
print('<==== Mapping.R ====>')
suppressMessages({
@dustincys
dustincys / scrapy_csv_exporter.md
Created April 28, 2020 03:47 — forked from jbinfo/scrapy_csv_exporter.md
How to create a Scrapy CSV Exporter with a custom delimiter and order fields

Create a scrapy exporter on the root of your scrapy project, we suppose the name of your project is my_project, we can name this exporter: my_project_csv_item_exporter.py

from scrapy.conf import settings
from scrapy.contrib.exporter import CsvItemExporter

class MyProjectCsvItemExporter(CsvItemExporter):

    def __init__(self, *args, **kwargs):
 delimiter = settings.get('CSV_DELIMITER', ',')
@dustincys
dustincys / paper.tex
Created January 21, 2014 08:53
中文文章XeLaTeX模板
%!Tex Program = xelatex
% -*-coding: utf-8 -*-
\documentclass[twocolumn]{article}
\usepackage[a4paper,text={180true mm,240true mm}]{geometry}
%\usepackage[a4paper,text={150true mm,224true mm},top=35.5true mm,left=30true mm,head=5true mm,headsep=2.5true mm,foot=8.5true mm]{geometry}
\usepackage[BoldFont,SlantFont]{xeCJK}
\usepackage{amsmath,latexsym,amssymb,amsfonts,amsbsy}
\usepackage{multirow} %使用Multirow宏包,使得表格可以合并多个row 格
\usepackage{booktabs} % 表格,横的粗线;\specialrule{1pt}{0pt}{0pt}
@dustincys
dustincys / radio.sh
Last active April 26, 2016 01:47
radio
#!/bin/bash
# radio station CRI\CNN for HIT
usage(){
echo "usage: ./radio.sh [ [ [ -s | --station ] [ -c | --cache ] ] | [ -h | --help ] ]"
}
station="http://am846-lh.akamaihd.net/i/am846_1@301569/master.m3u8"
cache=500
@dustincys
dustincys / router.sh
Created March 13, 2016 10:36
reboot router automatically
#!/bin/bash
retval=1
testInternet(){
sleep 10
wget -q --tries=10 --timeout=20 --spider http://www.baidu.com
date
if [[ $? -eq 0 ]]; then
retval=1
echo "Online!"
color.bar <- function(
lut, min, max=-min, nticks=11,
ticks=seq(min, max, len=nticks), title='',cexv=0.5
)
{
min<-as.integer(min);
max<-as.integer(max)+1;
scale = (length(lut)-1)/(max-min)
#dev.new(width=1.75, height=5)
# Conky settings #
background no
update_interval 1
cpu_avg_samples 2
net_avg_samples 2
override_utf8_locale yes
double_buffer yes
@dustincys
dustincys / article-style.css
Last active January 3, 2016 13:48
css for goldendict
body{
color:#b08d58;
background:black;
}
.dsl_m1 {
font-family: Agency FB;
font-weight: bold;
color: #FF33FF;
font-size: 22px;
}
@dustincys
dustincys / duoshuo.css
Created January 17, 2014 10:50
css configuration of duoshuo
#ds-thread .ds-powered-by{display:none!important;}
#ds-reset .ds-avatar img{
-webkit-border-radius: 0px;
border-radius: 0px;
}
#ds-thread #ds-reset .ds-user-name {
font-size: 16px;
line-height: 20px;
}
#ds-thread #ds-reset .ds-comment-body p {