This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* ==VimperatorPlugin== | |
* @name foxyproxy.js | |
* @description foxyproxy helper | |
* @minVersion 0.1pre | |
* @author Frei Zhang | |
* @version 0.1.0 | |
* ==/VimperatorPlugin== | |
* | |
* Usage: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun ifree--format-article (begin end) | |
"Add space between Chinese and English letters between BEGIN and END." | |
(interactive "r") | |
(let (region-begin | |
region-end | |
(matcher-begin "\\(?1:[\u4e00-\u9fa5]+\\)\\(?2:[a-zA-Z]+\\)") ;cjk, | |
;symbols? | |
(matcher-end "\\(?1:[a-zA-Z]+\\)\\(?2:[\u4e00-\u9fa5]+\\)")) | |
(if (region-active-p) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun ifree-org-html-get-body (&optional buffer) | |
"Export BUFFER to html body." | |
(let ((html-content)) | |
(save-excursion | |
(org-html-export-as-html nil nil t t) | |
(with-current-buffer "*Org HTML Export*" | |
(setq html-content | |
(buffer-substring-no-properties (point-min) (point-max))) | |
(kill-buffer-and-window))) | |
html-content)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name site-monit | |
// @namespace com.ifree.common | |
// @version 1 | |
// @grant none | |
// @match *://*.zhihu.com/* | |
// @match https://*.twitter.com/* | |
// @match https://*.weibo.com/* | |
// @match https://plus.google.com/* | |
// ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name image viewer | |
// @namespace com.ifree.common | |
// @description image viewer http://slideshow.triptracker.net/index.html | |
// @include http://bugtracker/bugtracker/* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
(function () { | |
var MESSAGES = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Constants.au3> | |
#include <WinAPI.au3> | |
#include <Array.au3> | |
#include <WindowsConstants.au3> | |
#include <Debug.au3> | |
_DebugSetup("", True) | |
Local $win = WinWait("Save Package") | |
Local $win_handle = WinGetHandle("Save Package") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Constants.au3> | |
#include <WinAPI.au3> | |
#include <Array.au3> | |
#include <WindowsConstants.au3> | |
#include <Debug.au3> | |
_DebugSetup("", True) | |
Local $win = WinWait("Import") | |
Local $num = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 2.8.5) | |
set(PROJECT_NAME, gl_playground) | |
#libs | |
INCLUDE(FindPkgConfig) | |
PKG_SEARCH_MODULE(GLEW REQUIRED glew) | |
PKG_SEARCH_MODULE(SDL2 REQUIRED sdl2) | |
PKG_SEARCH_MODULE(SDL2_image REQUIRED SDL2_image) | |
PKG_SEARCH_MODULE(GL REQUIRED gl) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun js2-remap-array () | |
"replace array expression with real value, eg. arr[1] into 123" | |
(interactive) | |
(let* | |
( | |
(node (js2-node-at-point)) | |
(current-start (js2-node-abs-pos node)) | |
(current-pos current-start) | |
(offset 0) | |
(elems (js2-array-to-list node)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun js2-array-to-list (&optional node) | |
"convert array to list" | |
(let ((node (or node (js2-node-at-point))) | |
elems) | |
(unless (js2-var-init-node-p (js2-node-parent node)) | |
(error "invalid node")) | |
(setq elems (js2-array-node-elems | |
(js2-var-init-node-initializer | |
(js2-node-parent node)))) | |
(mapcar (lambda (x) (js2-node-string x)) elems))) |