群点科技

科技改变生活


  • 首页

  • 关于

  • 标签

  • 分类

  • 归档

  • 站点地图

JavaScript代码片段

发表于 2015-06-12 | 分类于 JavaScript

编辑器

在html5中新多了一个特性,叫做contenteditable,这个特性可以让html里的一个元素变成可编辑状态。因此,我们可以通过这个属性来构造一个简单的文本编辑器。
在浏览器里新建一个标签页输入网址
data:text/html,<html contenteditable>
你会发现你的浏览界面变成了一个简单的文本编辑器。

montas 的改造:You can use textarea and make it “invisible” if you want autofocus.

1
data:text/html, <textarea style="font-size: 1.5em; width: 100%; height: 100%; border: none; outline: none" autofocus />

bgrins 的改造:编辑内容时,自动变换背景颜色;停止后变换白色。

1
data:text/html, <html><head><style type="text/css"> html { font-family: "Open Sans" } * { -webkit-transition: all linear 1s; }</style><script>window.onload=function(){var e=false;var t=0;setInterval(function(){if(!e){t=Math.round(Math.max(0,t-Math.max(t/3,1)))}var n=(255-t*2).toString(16);document.body.style.backgroundColor="#ff"+n+""+n},1e3);var n=null;document.onkeydown=function(){t=Math.min(128,t+2);e=true;clearTimeout(n);n=setTimeout(function(){e=false},1500)}}</script></head><body contenteditable style="font-size:2rem;line-height:1.4;max-width:60rem;margin:0 auto;padding:4rem;">

fvsch 的改造:

阅读全文 »

Privoxy

发表于 2015-06-06 | 分类于 GFW

USAGE:

  • Privoxy - Home Page

  • 使用Privoxy建立代理中心,共享任意代理资源 - Velaciela

  • privoxy——广告过滤和自动代理切换 [Lainme’s Blog]
  • privoxy过滤规则浏览器讨论区软件区 卡饭论坛 - 互助分享 - 大气谦和!
  • [总结]利用 Privoxy 让命令行下的 wget 和 curl 等命令实现自动代理 - 幸福飞过海
  • 给MACosx(终端)也插上翻墙的翅膀–Privoxy使用手记 - 好代码编程网
  • 如何用 Privoxy 辅助翻墙? @ 编程随想的博客

阅读全文 »

baidu OCR

发表于 2015-06-06 | 分类于 OCR

百度OCR文字识别API for Python

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys, urllib, urllib2, json
f = open("test.txt","w")
url = 'http://apis.baidu.com/apistore/idlocr/ocr'

data = {}
data['fromdevice'] = "pc"
data['clientip'] = "10.10.10.0"
data['detecttype'] = "LocateRecognize"
data['languagetype'] = "CHN_ENG"
data['imagetype'] = "1" #`2`代表图片原文件(只支持JPG)
data['image'] = "" ##image base64 data

decoded_data = urllib.urlencode(data)
req = urllib2.Request(url, data = decoded_data)

req.add_header("Content-Type", "application/x-www-form-urlencoded")
req.add_header("apikey", "自己的apikey")

resp = urllib2.urlopen(req)
content = resp.read()
if(content):
print(content)
f.write(content)
阅读全文 »

ADBLOCK block list

发表于 2015-06-06 | 分类于 GFW
  • 用浏览器扩展ADBLOCK过滤掉以下网址,可提高个别网站的访问速度。

  • 如何发现拖慢网站访问速度的链接

    当发现网站在加载某一个链接时,迟迟打不开,就可以block掉这个网址了。

1
2
3
4
5
6
7
8
9
10
11
12
tags.crwdcntrl.net
fonts.googleapis.com
googletagservices.com
connect.facebook.net
translate.googleapis.com
chart.googleapis.com
maps.googleapis.com
adwords.google.com
apis.google.com
googleapis-ajax.l.google.com
google-analytics.com
ajax.googleapis.com
阅读全文 »

CNNIC证书

发表于 2015-06-03 | 分类于 GFW
  • CNNIC证书的清除方法 -月光博客
  • CNNIC 证书的危害及各种清除方法 @ 编程随想的博客
  • 已经越狱的 iOS 设备上 屏蔽系统内置根证书的插件已经出来了 - V2EX

A Programmer's Rantings

发表于 2015-06-01 | 分类于 note

language

  • 汇编
  • C D
  • Lisp Scheme Clojure
  • C++ Java
  • Perl Ruby Python JRuby Jython Rhino Groovy Smalltalk Cobol Fortran
  • Haskell Lua
  • 并行语言Erlang
  • R Matlab Mathematica

Web框架

  • Pylons
  • Django
  • TurboGears
  • Zope
  • Subway

TextEditor

  • Emacs
  • Elisp
  • Eclipse
  • IntelliJ
    阅读全文 »

Help Sheet

发表于 2015-05-31 | 分类于 Sheet
  • WP Help Sheet
  • tiimgreen/github-cheat-sheet

Frontend Knowledge Structure

发表于 2015-05-31 | 分类于 前端


阅读全文 »

Swift Style guide

发表于 2015-05-26 | 分类于 Swift

A guide to our Swift style and conventions.

This is an attempt to encourage patterns that accomplish the following goals (in
rough priority order):

  1. Increased rigor, and decreased likelihood of programmer error
  2. Increased clarity of intent
  3. Reduced verbosity
  4. Fewer debates about aesthetics

If you have suggestions, please see our contribution guidelines,
then open a pull request. :zap:


Whitespace

  • Tabs, not spaces.
  • End files with a newline.
  • Make liberal use of vertical whitespace to divide code into logical chunks.
  • Don’t leave trailing whitespace.
    • Not even leading indentation on blank lines.
阅读全文 »

GFW

发表于 2015-05-24 | 分类于 GFW

ip,镜像站

寻找可用ip,修改系统host

  • Google 镜像站搜集 - Techzero
    1
    http://www.findspace.name/adds/hosts2

更改网络DNS

  • Hello DNS (可直接翻墙)

    1
    2
    DNS1: 123.56.46.123
    DNS2: 182.254.185.148
  • 任我行DNS(可直接翻墙)

    1
    121.201.13.176
阅读全文 »
1234

qunwang6

38 日志
21 分类
38 标签
GitHub Twitter Gmail
© 2018 qunwang6
由 Hexo 强力驱动
|
主题 — NexT.Muse v5.1.4