Skip to content

Instantly share code, notes, and snippets.

View vincent178's full-sized avatar
💭
Hacking

Vincent Huang vincent178

💭
Hacking
View GitHub Profile
@vincent178
vincent178 / obsidian.py
Created September 1, 2023 22:42
A python script to migrate obsidian notes to logseq, including tasks and daily notes, use at your own risk.
from datetime import datetime
import re
import os
import shutil
# migrate obsidian note to logseq
# input: - [ ] Rename `dev-triage-china` to `cn-triage` 📅 2023-09-01
# output:
# - TODO aa
# SCHEDULED: <2023-08-30 Wed>
#!/bin/bash
set -eof pipefail
# download proxy list from provider
proxies=$(cat /tmp/dler | awk -F \= '{ print $1"," }' | tr -d '\n' | sed 's/,$//')
echo "[Proxy]
$(cat /tmp/dler)
// ==UserScript==
// @name Github Unsubscribe
// @namespace http://tampermonkey.net/
// @version 0.3
// @description Unsubscribe merged or closed threads!
// @author You
// @match https://github.com/notifications
// @grant none
// ==/UserScript==
@vincent178
vincent178 / gist:353d4f8b5ff20dac6eac081d40a7c214
Created August 17, 2017 13:18
change key repeat for Mac
defaults write -g InitialKeyRepeat -int 10 # normal minimum is 15 (225 ms)
defaults write -g KeyRepeat -int 1 # normal minimum is 2 (30 ms)
import * as webpack from "webpack";
import * as ExtractTextPlugin from "extract-text-webpack-plugin";
import * as ManifestPlugin from "webpack-manifest-plugin";
import {TypedContext} from "../server/TypedContext";
const css = new ExtractTextPlugin(TypedContext.isProduction() ? "[name].[contenthash].css" : "[name].css");
const manifest = new ManifestPlugin({
writeToFileEmit: true
@vincent178
vincent178 / f2e
Created June 8, 2015 09:23
前端面试题
https://github.com/h5bp/Front-end-Developer-Interview-Questions
https://github.com/paddingme/Front-end-Web-Development-Interview-Question
@vincent178
vincent178 / ember.md
Created July 30, 2014 08:03
ember code snippet

Model

App.User = Ember.Object.extend({
    
    firstName: 'Hello',
    lastName: 'world',
    
    fullName: (function() { 
 console.log(this.get('firstName'));
Key mappings
Add your preferred key mappings to your .vimrc file.
" RSpec.vim mappings
map <Leader>t :call RunCurrentSpecFile()<CR>
map <Leader>s :call RunNearestSpec()<CR>
map <Leader>l :call RunLastSpec()<CR>
map <Leader>a :call RunAllSpecs()<CR>

linux current folder disk usage

du -h -d 1

Create a Database

mysql> CREATE DATABASE php_app;

Create a table

Create a Database

CREATE TABLE admin