Skip to content

Instantly share code, notes, and snippets.

View wonderffee's full-sized avatar

wonderffee

View GitHub Profile
@sartak
sartak / a.md
Last active June 26, 2024 04:59
Anki 2 annotated schema
@ambar
ambar / nospm.user.js
Last active May 26, 2024 09:29
nospm 移除虾米、淘宝和 Bilibili 网址中的 spm 参数(包括地址栏和页面中的链接),推荐使用 Tampermonkey 或者 Violentmonkey 安装,UserScript 安装地址 https://gist.github.com/ambar/9706385/raw/nospm.user.js
// ==UserScript==
// @name nospm
// @version 1.4.0
// @run-at document-start
// @updateURL https://gist.github.com/ambar/9706385/raw/nospm.user.js
// @downloadURL https://gist.github.com/ambar/9706385/raw/nospm.user.js
// @description 移除 Bilibili、淘宝、天猫、优酷网址中的 spm 参数(包括地址栏和页面中的链接)
// @include https://*.bilibili.com/*
// @include https://*.taobao.com/*
// @include https://*.tmall.com/*
@Zulko
Zulko / 3D_piano_from_midi.py
Last active April 9, 2024 05:51
Turn a piano MIDI file into a basic 3D animated piano video.
"""
Turn a piano MIDI file into a basic 3D animated piano video.
See the result here:
I am leaving it as a script because it is not tested on enough MIDI files yet.
Zulko 2014
This script is released under a Public Domain (Creative Commons 0) licence.
@implementation NSBundle (MYBundle)
+ (instancetype)MYBundle{
NSBundle *mainBundle = [NSBundle mainBundle];
NSURL *bundleUrl = [mainBundle URLForResource:@"MyBundle" withExtension:@"bundle"];
NSBundle *bundle = [NSBundle bundleWithURL:bundleUrl];
return bundle;
}
+ (UIImage*)imageNamed:(NSString*)name{
UIImage *image;
@cuibonobo
cuibonobo / manage_internet_sharing.md
Created August 3, 2015 16:53
Manage internet sharing on Mac OS X
  • Get the currently connected computers: arp -i en1 -a and arp -i bridge100 -a
  • Filter connections by MAC address: http://michaelleo.com/blog/2011/02/eye-fi-upload-via-mac-os-x-internet-sharing/
  • Grab the list of DHCP leases from /private/var/db/dhcpd_leases (this won't necessarily tell you who is connected, but it's good for knowing who has connected)
  • Enable Internet Sharing with sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.InternetSharing.plist (and use unload to disable)
  • Messing with the Internet Sharing settings directly is giving me inconsistent results. For my particular case, it's easiest to just set up my Sharing settings manually and then turn the WiFi on and off based on my needs with networksetup -setairportpower en1 on or networksetup -setairportpower en1 off
@CraigSiemens
CraigSiemens / iflet.m
Last active May 2, 2021 02:09 — forked from jspahrsummers/iflet.m
if-let and guard macros for Objective C
#import <Foundation/Foundation.h>
// VARIABLE must be a variable declaration (NSString *foo)
// VALUE is what you are checking is not nil
// WHERE is an additional BOOL condition
#define iflet(VARIABLE, VALUE) \
ifletwhere(VARIABLE, VALUE, YES)
#define ifletwhere(VARIABLE, VALUE, WHERE) \
@dofy
dofy / ve2x.date.user.js
Last active January 26, 2016 06:43
显示 v2ex 绝对时间
// ==UserScript==
// @name v2ex 绝对时间
// @namespace http://phpz.org/
// @version 0.1.5
// @description 显示 v2ex 中的绝对时间
// @author Seven Yu
// @match *.v2ex.com/*
// @run-at document-end
// @grant none
// @updateURL https://gist.github.com/dofy/38c8d67405a5597f4e7e/raw
@ShiningRay
ShiningRay / init.lua
Created April 7, 2017 09:16
automaticly focus the frontmost window when mouse changed to another screen
-- hs.logger.setGlobalLogLevel('debug')
local logger = hs.logger.new('focus')
hs.timer.doEvery(3, function()
local current = hs.mouse.getCurrentScreen()
-- hs.rawprint(current)
if current and current ~= hs.screen.mainScreen() then
local windows = hs.window.orderedWindows()
for _, l in ipairs(windows) do
if l:screen() == current and l:isStandard() and l:isVisible() then
如果你连挣钱都要别人开导你,要盯着,看着,哄着,鼓励着,劝你还是别干了,你就应该穷。
古之成大事者,不惟有超世之才,亦必有艰苦不拔之志
不用去追一匹马,用追马的时间种草,待春暖花开,会有骏马任你挑选。
坚定目标,持续前进,承受痛苦
如果周围没有优秀的人,那就让自己成为最优秀的人
唯有自律可以自救,自律是捍卫时间与自由的唯一手段,自律能带来精神上的免疫,对无用信息免疫
明确你的目标,不要用战术上的勤奋掩盖战略上的懒惰
天助自助者
你的努力,决定孩子坐在哪里!你的努力,决定父母晚年的生活!
世界上最幸福的事之一,莫过于经过一番努力后,所有东西正慢慢变成你想要的样子。
@dbrookman
dbrookman / build-mpv_silicon.sh
Last active July 24, 2024 18:10
How to build mpv & mpv.app on an Apple silicon Mac
#!/usr/bin/env bash
# Builds mpv & mpv.app on Apple silicon Macs.
# Run this script from the root directory of the mpv repo.
# if anything fails, gtfo
set -ex
meson setup build
meson compile -C build