Skip to content

Instantly share code, notes, and snippets.

@uranusjr
uranusjr / better-python-env.md
Last active June 8, 2023 14:11
Toward a better Python installation

Toward a better Python installation

Meta

想要的特質

  • 不會太污染 PATH
  • 盡可能避免要求 root/admin 權限
  • 可以同時安裝多個版本(只需要到 minor,不須 patch)
  • 可以輕鬆啟動任意一個版本的 Python,不須多餘設定,版本之間也不會互相衝突
@yurenju
yurenju / watch.js
Last active October 3, 2015 02:23
#!/usr/bin/env node
var fs = require('fs');
var path = require('path');
require('shelljs/global');
fs.watch('client', {recursive: true}, function(event, filename) {
exec('mocha -t 5000 --harmony --growl ' +
'test/test.' + path.basename(filename));
@import Foundation;
@interface KKWatchAppNotificationCenter : NSObject
+ (instancetype)sharedCenter;
- (void)postNotification:(NSString *)key;
- (void)addTarget:(id)target selector:(SEL)selector name:(NSString *)notification;
- (void)removeObserver:(NSObject *)observer;
@end
@visioncan
visioncan / CasksInstall.sh
Last active December 29, 2021 01:56
CasksInstall
#!/bin/bash
# xcode command tool
xcode-select --install
# check
xcode-select -p
# homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
@archon810
archon810 / BuildConfig.java
Last active September 28, 2022 15:17
Fake Virus Shield AV
package com.deviant.security.shield;
public final class BuildConfig {
public static final String BUILD_TYPE = "debug";
public static final boolean DEBUG;
public static final String FLAVOR = "";
public static final String PACKAGE_NAME = "com.deviant.security.shield";
public static final int VERSION_CODE = 4;
public static final String VERSION_NAME = "2.2";
@darknoon
darknoon / OutlineView.m
Last active September 6, 2016 05:11
This is the simplest way I could figure out how to make a view-based NSOutlineView
@interface AppDelegate : NSObject <NSApplicationDelegate, NSOutlineViewDataSource, NSOutlineViewDelegate>
@end
@implementation AppDelegate {
NSWindow *_w;
NSDictionary *_data;
}
[difftool "Kaleidoscope"]
cmd = ksdiff --partial-changeset --relative-path \"$MERGED\" -- \"$LOCAL\" \"$REMOTE\"
[diff]
tool = Kaleidoscope
[difftool]
prompt = false
[mergetool "Kaleidoscope"]
cmd = ksdiff --merge --output \"$MERGED\" --base \"$BASE\" -- \"$LOCAL\" --snapshot \"$REMOTE\" --snapshot
trustExitCode = true
[mergetool]
@hanksudo
hanksudo / Front-end-Developer-Interview-Questions-TC.md
Last active September 12, 2024 07:05
Front-end-Developer-Interview-Questions - 前端工程師面試問題集(繁體中文版)

前端工程師面試問題集

@版本 2.0.0

譯注:此翻譯版,主要給不能流利的讀英文的人看,相關專有名詞還是保留原文。翻譯不好地方請協助pull request.

此repository包含了一些前端開發的面試問題,來審查一個有潛力的面試者。這並不是建議你對同一個面試者問上所有的問 (那會花費好幾小時)。從列表中挑幾個題目,應該就夠幫助你審查面試者是否擁有你需要的技能。

Rebecca MurpheyBaseline For Front-End Developers 也是一篇很棒且值得讀的文章在你開始面試之前。

@christianroman
christianroman / test.py
Created May 30, 2013 16:02
Bypass Captcha using 10 lines of code with Python, OpenCV & Tesseract OCR engine
import cv2.cv as cv
import tesseract
gray = cv.LoadImage('captcha.jpeg', cv.CV_LOAD_IMAGE_GRAYSCALE)
cv.Threshold(gray, gray, 231, 255, cv.CV_THRESH_BINARY)
api = tesseract.TessBaseAPI()
api.Init(".","eng",tesseract.OEM_DEFAULT)
api.SetVariable("tessedit_char_whitelist", "0123456789abcdefghijklmnopqrstuvwxyz")
api.SetPageSegMode(tesseract.PSM_SINGLE_WORD)
tesseract.SetCvImage(gray,api)
print api.GetUTF8Text()
[[NSLocale availableLocaleIdentifiers] enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:obj];
NSLog(@"<tr><td>%@</td><td>%@ / %@</td></tr>", locale.localeIdentifier, [[NSLocale systemLocale] displayNameForKey:NSLocaleIdentifier value:obj], [locale displayNameForKey:NSLocaleIdentifier value:obj]);
}];