Skip to content

Instantly share code, notes, and snippets.

View yfwu's full-sized avatar

Yu-Fu Wu yfwu

View GitHub Profile
# * write_to_file
# Writes text to a file. If file exists, appends the text at the end. If not, creates a new file.
# * del_file
# Deletes a file.
# * read_file
# Reads a file and returns the content.
# * add_task
@huytd
huytd / wordle.md
Last active May 16, 2024 20:39
Wordle in less than 50 lines of Bash

image

How to use:

./wordle.sh

Or try the unlimit mode:

@dannypsnl
dannypsnl / qs.rkt
Last active May 30, 2022 10:51
quick sort
#lang racket/base
(require racket/match
racket/list
racket/sequence
racket/random)
(define (is l)
(define (insert x ys)
(match ys
[(list) (list x)]
@wancw
wancw / 0 - Readme.md
Last active July 4, 2023 09:34
移除 macOS 健保卡元件

檔案說明

  • removeNHIICC.sh : 移除健保卡元件與相關設定,須以 root (sudo) 權限執行。
  • postinstall.sh : 官方「MAC 元件移除安裝檔」的 script 內容(2020)
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the active virtualenv
# * the branch/status of the current git repository
# * the return value of the previous command
# * the fact you just came from Windows and are used to having newlines in
# your prompts.
@mfikes
mfikes / fast.md
Last active January 6, 2024 07:19
Fast Clojure REPL

An experimental change for fast Clojure REPL startup:

  1. Download the JAR: clojure-1.8.0-fast.jar
  2. Launch it via java -jar clojure-1.8.0-fast.jar

The code used to create this JAR is on GitHub.

What's it doing?

It is:

@kanru
kanru / diary-sync-ical.el
Created January 22, 2015 11:54
Sync icalendar to diary file
;;; diary-sync-ical.el --- Sync iCalendar to diary -*- lexical-binding: t; -*-
;; Copyright (C) 2015 Kan-Ru Chen (陳侃如)
;; Author: Kan-Ru Chen (陳侃如) <kanru@kanru.info>
;; Keywords:
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
@emallson
emallson / nodejs-repl-eval.el
Created May 30, 2014 02:30
Evaluation functions for the `nodejs-repl' Emacs package.
;;; nodejs-repl-eval.el --- Summary
;;; Commentary:
;;;
;;; Evaluation functions for the `nodejs-repl' package. Written on a stormy
;;; night between days of node hacking.
;;;
;;; Code:
(require 'js2-mode)
(require 'nodejs-repl)
import subprocess
import select
from threading import Thread
from cStringIO import StringIO
def read_stream(stream, output_stream, log_func):
while True:
r, w, x = select.select([stream.fileno()], [], [], 1.0)
if not r:
@10long
10long / geeknote.el
Created February 17, 2014 03:39
geeknote call inside emacs
;; geeknote ==============================================================
(defun geeknote-mode ()
(interactive)
(eshell-command "python ~/geeknote/geeknote.py settings --editor /Applications/Emacs.app/Contents/MacOS/bin/emacsclient")
)
(defun geeknote-create (newnote)
(interactive "sname: ")
(eshell-command
(format "python ~/geeknote/geeknote.py create --content WRITE --title %s" newnote))