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 / 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!"
@dustincys
dustincys / letsrock.sh
Last active August 29, 2015 14:25
tmux script
#!/bin/sh
tmux -2 new-session -d -s back
tmux new-window -t back:1 -n 'proxy'
tmux send-keys "proxyAll.sh" C-m
tmux new-window -t back:2 -n 'radio'
tmux send-keys "radio.sh" C-m
tmux -2 new-session -d -s work
###########################################################################
# General options
# Default termtype. If the rcfile sets $TERM, that overrides this value.
#set -g default-terminal screen-256color
# Ring the bell if any background window rang a bell
set -g bell-action any
# Watch for activity in background windows
@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 / markup.py
Created May 16, 2015 04:56
rednotebook2
CHARSET_UTF8 = '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />'
CSS = """\
<style type="text/css">
body {
font-family: %(font)s;
background: black;
color: gray;
}
<!-- Don't split last line between pages.
@dustincys
dustincys / qt-style.css
Created March 24, 2014 13:23
qt style for goldendict
MainWindow #searchPane #translateLine, MainWindow #searchPane #wordList
{
background: black;
color: gray;
}
MainWindow #translateLine, ScanPopup #translateLine, MainWindow #wordList, MainWindow #dictsPane #dictsList, MainWindow #historyPane #historyList
{
background: black;
color: gray;
}
sudo apt-get install ruby1.9.1
sudo apt-get install ruby1.9.1-dev
sudo gem install jekyll
sudo apt-get install git
sudo gem install rdiscount