Skip to content

Instantly share code, notes, and snippets.

View 007slm's full-sized avatar

007slm 007slm

  • devplus.io
  • beijing
View GitHub Profile
@007slm
007slm / methodInvokeProxy;
Created March 25, 2022 02:11
js 方法拦截 可以通过这个方式拦截fs的api 达到重定向文件操作的目的
function traceMethodCalls(obj) {
let console = globalThis.console;
let handler = {
get(target, propKey, receiver) {
const origMethod = target[propKey];
return function (...args) {
let result = origMethod.apply(this, args);
console.log(propKey + JSON.stringify(args)
+ ' -> ' + JSON.stringify(result));
return result;
@007slm
007slm / designer.html
Last active August 29, 2015 14:07
designer
<link rel="import" href="../cool-clock/cool-clock.html">
<link rel="import" href="../google-map/google-map-search.html">
<link rel="import" href="../google-map/google-map-directions.html">
<link rel="import" href="../google-map/google-map.html">
<link rel="import" href="../core-ajax/core-ajax.html">
<link rel="import" href="../core-animated-pages/core-animated-pages.html">
<link rel="import" href="../core-animated-pages/transitions/hero-transition.html">
<link rel="import" href="../core-animated-pages/transitions/cross-fade.html">
<link rel="import" href="../core-animated-pages/transitions/slide-down.html">
<link rel="import" href="../core-animated-pages/transitions/slide-up.html">
@007slm
007slm / ios7_icon_css3
Created March 10, 2014 13:56
create ios7 icon by css3
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>ios7 icon</title>
<script type="text/javascript" src="http://s0.qhimg.com/lib/jquery/183.js"></script>
<style>
body{ margin: 0; height:570px; padding: 20px; -webkit-text-size-adjust: none; background:-webkit-gradient(linear ,0 0 ,100% 50% ,color-stop(0.15,#5a69b4),color-stop(0.5,#2d7cb6), color-stop(1,#bb73bf )); background: -moz-linear-gradient( left, #5a69b4, #2d7cb6 , #bb73bf ); background: -o-linear-gradient( left, #5a69b4, #2d7cb6 , #bb73bf );}

#dot-vimrc在win7环境下的配置

首先要感谢Github,越来越发现这是个好东西。我依然是win7+gVIM.

神级东东在这里

{
"alignment_chars" : ["=", ":"]
}
@007slm
007slm / gist:7099308
Created October 22, 2013 11:57
console style chrome f12 eval this script
console.log("%cCosnole style!","font-family:'Segoe UI Light';background-image:-webkit-gradient(linear,0% 0%,100% 0%,color-stop(0%,#12BBD5),color-stop(20%,#BAF84A),color-stop(40%,#F7E22C),color-stop(60%,#F7AD51),color-stop(80%,#F76E8E),color-stop(100%,#AE37F9));padding:10px;background-origin:border-box;-webkit-background-clip:text;color:transparent;font-size:80px;");
@007slm
007slm / new_gist_file
Last active December 26, 2015 02:19
ubuntu12.04 安装官方发布最新版本 nodejs
ubuntu的官方源安装的nodejs是0.6版的,现在最新的nodejs已经是0.10了。
所以我们要更新一下nodejs在ubuntu上的源。
代码:
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
完事了输入:
@007slm
007slm / gist:7057546
Created October 19, 2013 15:44
ctrl-c 结束不掉命令 ubuntu 可以试试ctrl+d
Ubuntu: Ctrl-C no longer works in terminal
14 May 2009
The programmers behind gnome-terminal seem to have changed something to do with the way ctrl-c works. Now if you want to cancel a program that has the focus of the terminal and you hit ctrl-c then nothing will happen. That's because the gnome terminal is trying to copy text to the clipboard - perhaps your gnome-terminal's "copy to clipboard" command is set to ctrl-shift-c in which case you won't notice this problem!
The gnome-terminal used to "copy to clipboard" only if you had text selected and would issue a ctrl-c (and abort/cancel) if you had none selected. Now it always attempts to "copy to clipboard" regardless of whether you have text selected or not. The only way around this right now is to go into your keyboard shortcuts (in the Edit menu) and set Edit | Copy to something other than ctrl-c, I suggest the original gnome-terminal default of shift-ctrl-c.
Shame, since ctrl-c is used everywhere else for copy!
Alternatively, some programs will also
#########################################
RED_ORG="\033[0;31m"
GREEN_ORG="\033[0;32m"
NO_COLOR_ORG="\033[0m"
# youdao helpers
function t {
if [ $1 == "-a" ]; then
all=1
query=$(curl -s -o /dev/null -w %{url_effective} --get --data-urlencode "$2" "" | sed -e "s/\/\?//g")
@007slm
007slm / new_gist_file
Created October 14, 2013 06:52
jquery 中bind live delegate on的区别。
<script id="jquery_183" type="text/javascript" class="library" src="/js/sandbox/jquery/jquery-1.8.3.min.js"></script>
<div id="main">
<div id="warpperDiv">
<a href="#test" id ="test">dsfdsfsd</a>
</div>
</div>
------------------------------------------------------------------------
$(function(){