Skip to content

Instantly share code, notes, and snippets.

View timfanda35's full-sized avatar
🐻
Fly to the moon.

Bear Su timfanda35

🐻
Fly to the moon.
View GitHub Profile
@aadimator
aadimator / process_logseq_timestamped.js
Created February 12, 2022 17:46
LogSeq Timestamp Process
const notice = (msg) => new Notice(msg, 5000);
const log = (msg) => console.log(msg);
module.exports = async function processLogseq(params) {
const {app, quickAddApi: {yesNoPrompt, inputPrompt, utility}} = params;
const shouldRemove = await yesNoPrompt("Should I remove timestamps?", `If you say no, I'll process them to be default youtube timestamp links. If you say yes, I'll simply remove them.`);
let text = await utility.getClipboard();
text = text.toString();

將 kubectl 改成 k 並同時擁有 bash completion 的設定方法

自動修改

kubectl completion bash | sudo tee /etc/bash_completion.d/k > /dev/null
sudo sed -e 's/local commands=("kubectl")/local commands=("k")/g' /etc/bash_completion.d/k -i
sudo sed -e 's/__start_kubectl kubectl/__start_kubectl k/g' /etc/bash_completion.d/k -i
echo 'alias k=kubectl' | tee -a ~/.profile > /dev/null
. ~/.profile
@fkztw
fkztw / gtts-chinese.py
Last active July 9, 2017 20:15
在座的各位都是谷歌小姐
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# USAGE: `$ cat $text_file | python3 gtts-chinese.py`
import os
import sys
from gtts import gTTS

Ruby Association Certified Ruby Examination Gold Sample Questions

Q1. Assume that the following code must have the stated execution result.

__(1)__
x.each_line { |line| puts line }

[Execution Result]
apple
@jackgris
jackgris / build.gradle
Created June 6, 2014 18:51
Example of use from Proguard, from Android Studio
buildscript {
repositories {
mavenCentral()
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:0.9.+'
classpath 'com.squareup.gradle:gradle-android-test-plugin:0.9.1-SNAPSHOT'

專案名稱: Rails新手村網站

主旨:收集 Rails 有用 Link

基本功能

@tskaggs
tskaggs / OSX-Convert-MOV-GIF.md
Last active May 6, 2024 13:07
Creating GIFs from .MOV files in OSX using FFmpeg and ImageMagick

Convert MOV to GIF using FFmpeg and ImageMagick

I tried a few different techniques to make a GIF via command-line and the following gives me the best control of quality and size. Once you're all setup, you'll be pumping out GIFs in no time!

Preparation

Install FFmpeg

  • $ brew install ffmpeg [all your options]
    • Example: $ brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-frei0r --with-libass --with-libvo-aacenc --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-opus --with-rtmpdump --with-schroedinger --with-speex --with-theora --with-tools

Install ImageMagick

@pvdb
pvdb / process_rss.rb
Last active December 14, 2022 10:50
Get real memory (resident set) used by current Ruby process
#
# This first version should work on Mac OS X and Linux, but it spawns a process
#
# http://stackoverflow.com/questions/7220896/
# https://github.com/rdp/os/blob/master/lib/os.rb#L127
# http://www.ruby-doc.org/core-2.0/Process.html
#
# A better - but more complicated - way to achieve the same is documented here:
#
# https://build.betterup.com/tracking-a-processs-memory-usage-in-ruby/

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

@wlangstroth
wlangstroth / deploy.rb
Last active September 11, 2021 13:15
Capistrano + Nginx + Unicorn + Sinatra on Ubuntu
require 'bundler/capistrano'
set :application, "net"
set :repository, "git@githost.com:net.git"
set :scm, :git
set :default_environment, {
'PATH' => "$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH"
}