Skip to content

Instantly share code, notes, and snippets.

@linkarys
linkarys / sublime-plugin.py
Last active August 29, 2015 13:57
sublime plugin notes
### Insert text to new file
### ----------------------------------------------------
### ====================================================
import sublime
import sys
view = sublime.active_window().new_file()
def insert_text(view):
test:
npm install karma-jasmine --save-dev
npm install karma-chrome-launcher --save-dev
@linkarys
linkarys / command-profile.sh
Created April 20, 2014 01:08
command line profile
# See http://www.shellperson.net/using-sudo-with-an-alias/
alias sudo='sudo '
# This helps me edit files that my user isn't the owner of
alias edit='SUDO_EDITOR="open -FWne" sudo -e'
# The alias that takes me here - to editing these very aliases
alias edit_profile='open -e ~/.profile'
# I do a lot of web development, so I need to edit these non-owned files fairly often
<?php
class HurryHenryHooray {
const SEQ_START = 1; // 报数的起始值
const SEQ_END = 100; // 报数的结束値
private $map = []; // 保存数字与字符串的对应关系
public function HurryHenryHooray ($num1, $num2, $num3) {
if ( $this->isValid($num1) && $this->isValid($num2) && $this->isValid($num3) ) {
@linkarys
linkarys / XiamiUnlikeBtn
Last active August 29, 2015 14:21
Xiami musci unlike button
(function() {
var $player = $('#J_playTracksList'),
$controls = $player.find('.ui-track-control');
$player.off('click.xm.hate').on('click.xm.hate', '.no-more', function() {
var id = $(this).closest('.ui-track-item').data('sid');
$.get('http://www.xiami.com/kuang/unlike', $.param({id: id}));
console.log('unlike id:', id);
@linkarys
linkarys / ex.js
Created March 27, 2013 14:14
javascript: extend
/**************************************************************
author: linkarys
description: framework of javascript
date begin: 2012-9-8
**************************************************************/
/* =============================================================================
Shortcuts
========================================================================== */
@linkarys
linkarys / sublime-keybindings
Created March 27, 2013 14:28
sublime: key bindings
[
{ "keys": ["alt+x"], "command": "open_browser" },
{ "keys": ["ctrl+k", "ctrl+t"], "command": "title_case" },
{ "keys": ["alt+shift+j"], "command": "move_to", "args": {"to": "bol"}},
{ "keys": ["alt+shift+k"], "command": "move_to", "args": {"to": "eol"}},
{ "keys": ["ctrl+shift+r"], "command": "reindent" , "args": {"single_line": false}},
{ "keys": ["ctrl+alt+f"], "command": "pep8_autoformat" },
{ "keys": ["alt+shift+;"], "command": "run_macro_file", "args": {"file": "Packages/User/addnewlinewithsemi.sublime-macro" } },
{ "keys": ["alt+shift+l"], "command": "run_macro_file", "args": {"file": "Packages/User/addnewline.sublime-macro" } },
{ "keys": ["ctrl+shift+l"], "command": "run_macro_file", "args": {"file": "Packages/User/addnewlinewithcolon.sublime-macro" } },
@linkarys
linkarys / ryan.css
Created March 27, 2013 14:10
css: default
/*! ryan.css v1.1.0 */
/* ==========================================================================
HTML5 display definitions
========================================================================== */
html{background: none;height: 100%;}
::selection{background:#78a8a8;color:#f7f3e7;text-shadow:none;}
::-moz-selection{background:#78a8a8;color:#f7f3e7;text-shadow:none;}
::-webkit-selection{background:#78a8a8;color:#f7f3e7;text-shadow:none;}
@linkarys
linkarys / sublime-browser
Last active December 15, 2015 11:39
sublime: openbrowser
import sublime, sublime_plugin
import webbrowser
class openBrowser(sublime_plugin.TextCommand):
def run(self, edit):
url = self.view.file_name();
webbrowser.open_new(url)
@linkarys
linkarys / sublime-plugin-list
Last active December 15, 2015 11:39
sublime: pluginlist
AdvanceNewFile
Netus Fetch
Gist
SulimetLinter
ClipBoard History