diff --git a/.gitignore b/.gitignore index f32ef08a..d6b3592e 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,7 @@ node_modules dist .idea test +*.pyc +*.sublime-workspace +*.sublime-project +package_control_channel diff --git a/ChromeApp.zip b/ChromeApp.zip deleted file mode 100644 index d5955614..00000000 Binary files a/ChromeApp.zip and /dev/null differ diff --git a/ChromeApp/assets/icon128.png b/ChromeApp/assets/icon128.png deleted file mode 100644 index 5db6ed67..00000000 Binary files a/ChromeApp/assets/icon128.png and /dev/null differ diff --git a/ChromeApp/background.js b/ChromeApp/background.js deleted file mode 100644 index 442f75a1..00000000 --- a/ChromeApp/background.js +++ /dev/null @@ -1,9 +0,0 @@ -chrome.app.runtime.onLaunched.addListener(function(launchData) { - chrome.app.window.create( - 'index.html', - { - id: 'mainWindow', - bounds: {width: 980, height: 720} - } - ); -}); diff --git a/ChromeApp/index.html b/ChromeApp/index.html deleted file mode 100644 index 9528c6ca..00000000 --- a/ChromeApp/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - Codestin Search App - - - - - - diff --git a/ChromeApp/main.js b/ChromeApp/main.js deleted file mode 100644 index adbd1062..00000000 --- a/ChromeApp/main.js +++ /dev/null @@ -1,3 +0,0 @@ -window.onload = function() { - console.log('https://github.com/unbug/codelf'); -}; diff --git a/ChromeApp/manifest.json b/ChromeApp/manifest.json deleted file mode 100644 index 3bbfaf80..00000000 --- a/ChromeApp/manifest.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "manifest_version": 2, - "name": "Codelf-Best GitHub Stars organizer", - "short_name": "Codelf-Best GitHub Stars organizer", - "description": "Organize your GitHub stars and repositories.Search over projects from GitHub to find real-world usage variable names.", - "version": "1.3.1", - "minimum_chrome_version": "38", - - "icons": { - "128": "assets/icon128.png" - }, - "permissions": ["webview"], - "app": { - "background": { - "scripts": ["background.js"] - } - } -} diff --git a/ChromeApp/styles.css b/ChromeApp/styles.css deleted file mode 100644 index b8246932..00000000 --- a/ChromeApp/styles.css +++ /dev/null @@ -1,5 +0,0 @@ -html,body{ - width: 100%; - height: 100%; - -webkit-font-smoothing: antialiased; -} diff --git a/Context.sublime-menu b/Context.sublime-menu new file mode 100755 index 00000000..b874fd55 --- /dev/null +++ b/Context.sublime-menu @@ -0,0 +1,6 @@ +[ + { + "command": "codelf_selection", + "caption": "Codelf" + } +] diff --git a/Default.sublime-commands b/Default.sublime-commands new file mode 100755 index 00000000..48842db2 --- /dev/null +++ b/Default.sublime-commands @@ -0,0 +1,18 @@ +[ + { + "caption": "Codelf: Search from Input", + "command": "codelf_from_input" + }, + { + "caption": "Codelf: Search Selection", + "command": "codelf_selection" + }, + { + "caption": "E: Search from Input", + "command": "codelf_from_input" + }, + { + "caption": "E: Search Selection", + "command": "codelf_selection" + } +] diff --git a/Main.sublime-menu b/Main.sublime-menu new file mode 100755 index 00000000..83461813 --- /dev/null +++ b/Main.sublime-menu @@ -0,0 +1,25 @@ +[ + { + "caption": "Tools", + "mnemonic": "t", + "id": "tools", + "children": + [ + { + "caption": "Codelf", + "id": "codelf", + "children": + [ + { + "command": "codelf_from_input", + "caption": "Search From Input" + }, + { + "command": "codelf_selection", + "caption": "Search Selection" + } + ] + } + ] + } +] diff --git a/Mdnsearch.py b/Mdnsearch.py new file mode 100755 index 00000000..398eafae --- /dev/null +++ b/Mdnsearch.py @@ -0,0 +1,49 @@ +# available commands +# codelf_selection +# codelf_from_input + + +import sublime +import sublime_plugin + +import subprocess +import webbrowser + +try: + # python2 + from urllib import quote +except ImportError: + # python3 + from urllib.parse import quote + + +def SearchFor(text): + url = 'https://unbug.github.io/codelf/#' + quote(text) + webbrowser.open_new_tab(url) + + +class CodelfFromInputCommand(sublime_plugin.WindowCommand): + def run(self): + # Get the search item + self.window.show_input_panel('Codelf for', '', + self.on_done, self.on_change, self.on_cancel) + + def on_done(self, input): + SearchFor(input) + + def on_change(self, input): + pass + + def on_cancel(self): + pass + + +class CodelfSelectionCommand(sublime_plugin.TextCommand): + def run(self, edit): + for selection in self.view.sel(): + # if the user didn't select anything, search the currently highlighted word + if selection.empty(): + text = self.view.word(selection) + + text = self.view.substr(selection) + SearchFor(text) diff --git a/README.md b/README.md deleted file mode 100755 index 7c5f7efd..00000000 --- a/README.md +++ /dev/null @@ -1,58 +0,0 @@ - ![logo](http://unbug.github.io/codelf/resources/images/codelf_logo.png) - -Codelf -================= -Organize your GitHub stars and repositories.Search over projects from GitHub, Bitbucket, Google Code, Codeplex, Sourceforge, Fedora Project to find real-world usage variable names. - - >There are only two hard things in Computer Science: cache invalidation and naming things.-- Phil Karlton - ![twohardtings](http://unbug.github.io/codelf/resources/images/twohardtings.jpg) - -Apps -================= -[Codelf Chrome App](https://chrome.google.com/webstore/detail/codelf-best-github-stars/jnmjaglhmmcplekpfnblniiammmdpaan) - -Build -================= -1. install requirements run ```npm install``` -2. build and watch run ```gulp``` - -Thanks -================= - * API powerd by [searchcode](http://searchcode.com/) & [youdao](http://fanyi.youdao.com/) - * UI powerd by [Bootstrap v4.0](http://v4-alpha.getbootstrap.com/) - * Syntax highlighting of source code powerd by [google-code-prettify](https://github.com/google/code-prettify) - * [Google Lovefield](https://github.com/google/lovefield) - * [ZeroClipboard](https://github.com/zeroclipboard/zeroclipboard) - * Utils - [generator-webappstarter](https://github.com/unbug/generator-webappstarter) - * [Data Drive Management System](https://github.com/unbug/ddms) - - -Programming naming convention -============================= - * [Google Style Guides](https://github.com/google/styleguide) - * [The Ruby Style Guide](https://github.com/bbatsov/ruby-style-guide) - * [Style guide & coding conventions for Swift projects](https://github.com/github/swift-style-guide) - * CSS Architecture - * [OOCSS](http://github.com/stubbornella/oocss/wiki) - Object Oriented CSS - * [ACSS](https://www.lucidchart.com/techblog/2014/01/31/atomic-css-tool-set/) - Atomic CSS - * [oCSS](http://krasimir.github.io/organic-css/) - organic cascade style sheet - * [SMACSS](http://smacss.com/) - Scalable and Modular Architecture for CSS - * [BEM](http://bem.info/) [getbem](http://getbem.com/) - Block, Element, Modifier - - -Find me -================= - * Twitter [@unbug](https://twitter.com/unbug) - * 微博 [@听奏](http://weibo.com/unbug) - -Videos -=============== -[![Codelf first look](https://cloud.githubusercontent.com/assets/799578/12520673/e037c0c6-c180-11e5-8342-cb291b98dcab.png)](https://youtu.be/Uqg8HWaa-2c) - -Screenshots -================ -![search1](https://cloud.githubusercontent.com/assets/799578/12498414/5a95d06e-c0dd-11e5-8a38-247e294df7ab.png) -![search2](https://cloud.githubusercontent.com/assets/799578/12498417/5aaf5ce6-c0dd-11e5-96be-af3900407d51.png) -![search3](https://cloud.githubusercontent.com/assets/799578/12498416/5a99eff0-c0dd-11e5-8458-1668d72a27ed.png) -![bnk1](https://cloud.githubusercontent.com/assets/799578/12507895/9945d290-c133-11e5-8bb9-ff5d5dec0cfe.png) -![bmk2](https://cloud.githubusercontent.com/assets/799578/12507854/5d2d328a-c133-11e5-85eb-d4da1c38a747.png) diff --git a/cache.manifest b/cache.manifest deleted file mode 100644 index 15d32063..00000000 --- a/cache.manifest +++ /dev/null @@ -1,21 +0,0 @@ -CACHE MANIFEST -# Build: 20160124024506 - -CACHE: -resources/fonts/Dressedless_Three.svg -resources/fonts/Dressedless_Three.ttf -resources/fonts/FontAwesome.otf -resources/fonts/fontawesome-webfont.eot -resources/fonts/fontawesome-webfont.svg -resources/fonts/fontawesome-webfont.ttf -resources/fonts/fontawesome-webfont.woff -resources/fonts/fontawesome-webfont.woff2 -resources/images/codelf_logo.png -resources/images/paypal.png -resources/images/twohardtings.jpg -resources/images/wechatpay.jpg -resources/images/zhifubao.png -src/lib/libs.f851782e.js - -NETWORK: -* diff --git a/gulpfile.js b/gulpfile.js deleted file mode 100755 index 2e02614a..00000000 --- a/gulpfile.js +++ /dev/null @@ -1,128 +0,0 @@ -var gulp = require('gulp'); -var through2 = require('through2'); -var $ = require('gulp-load-plugins')(); -var runSequence = require('run-sequence'); -var browserSync = require('browser-sync');//http://www.browsersync.io/docs/gulp/ -var reload = browserSync.reload; -var cachebust = new $.cachebust(); -require('date-utils'); - -//build version: -//script version -//style version -//manifest version -var startTime = 0; -var buildVersion = 0; -gulp.task('build_version', function (cb) { - var startDate = new Date(); - startTime = startDate.getTime(); - buildVersion = startDate.toFormat('YYYYMMDDHHMISS'); - - cb(); -}); - -//watching script change to start default task -gulp.task('watch', function () { - return gulp.watch([ - 'gulpfile.js', - './static/app/**/*.*' - ], function (event) { - console.log('File ' + event.path + ' was ' + event.type + ', running tasks...'); - runSequence('compile'); - }); - -}); -//clear dist folder -gulp.task('clean:dist', function (cb) { - return gulp.src(['./src/lib/*.js']) - .pipe($.clean({force: true})) -}); - -gulp.task('dist:js', function (cb) { - var dir = './static/app/src/lib/'; - gulp.src([dir+'jquery.min.js', - dir+'tether.min.js', - dir+'bootstrap.min.js', - dir+'prettify.js', - dir+'ZeroClipboard.min.js', - dir+'lovefield.min.js', - dir+'fastclick.js']) - .pipe($.cached('build-cache', { - optimizeMemory: true - })) - .pipe($.concat('libs.js')) - .pipe(cachebust.references()) - .pipe($.uglify()) - .pipe(cachebust.resources()) - .pipe(gulp.dest('./src/lib/')) - .on('end', function () { - cb(); - }); -}); -gulp.task('dist:html', function () { - return gulp.src(['./static/app/*.html']) - .pipe($.fileInclude({ - basepath: './static/app/' - })) - .pipe(cachebust.references()) - .pipe($.htmlmin({ - collapseWhitespace: true, - removeComments: true, - minifyJS: true, - minifyCSS: true - })) - .pipe(gulp.dest('./')); -}); -//generate cache.manifest -gulp.task('manifest', function (cb) { - var resources = []; - gulp.src(['./resources/**/*.*','./src/**/*.js']) - .pipe(through2.obj(function (file, enc, next) { - this.push(file.path.replace(__dirname+'/','')); - next(); - })) - .on('data', function (data) { - resources.push(data) - }) - .on('end', function () { - gulp.src(['./static/app/cache.manifest']) - .pipe($.replace(/_BUILD_VERSION_/g, buildVersion)) - .pipe($.replace(/_FILES_/g, resources.join('\n'))) - .pipe(gulp.dest('./')) - .on('end', function () { - cb(); - }); - }); -}); - -//browser-sync serve -gulp.task('serve', function () { - browserSync({ - "open": false, - server:{ - dir: './' - } - }); - - gulp.watch(['./*.html'], reload); -}); - -//print after tasks all done -gulp.task('_endlog', function (cb) { - var endDate = new Date(); - var logs = []; - logs.push('\nBuild version is ' + buildVersion); - logs.push(', Completed in ' + ((endDate.getTime() - startTime) / 1000) + 's at ' + endDate + '\n'); - console.log(logs.join('')); - cb(); -}); - -gulp.task('prepare', function (cb) { - runSequence('build_version', cb); -}); -gulp.task('compile', function (cb) { - runSequence('prepare', 'dist:js', 'dist:html', 'manifest', cb); -}); -gulp.task('default', function (cb) { - runSequence('clean:dist', 'compile', 'watch', 'serve', cb); -}); diff --git a/index.html b/index.html deleted file mode 100644 index afda6782..00000000 --- a/index.html +++ /dev/null @@ -1,93 +0,0 @@ -Codestin Search App

CODELF

Search over projects from GitHub, Bitbucket, Google Code and more to find
real-world usage variable names
Issue?
\ No newline at end of file diff --git a/package.json b/package.json deleted file mode 100644 index 4a4a3dfe..00000000 --- a/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "Codelf", - "version": "0.0.3", - "description": "Organize your GitHub stars and repositories.Search over projects from GitHub, Bitbucket, Google Code, Codeplex, Sourceforge, Fedora Project to find real-world usage variable names.", - "dependencies": {}, - "devDependencies": { - "browser-sync": "^2.2.4", - "date-utils": "^1.2.16", - "gulp": "^3.9.0", - "gulp-cachebust": "0.0.6", - "gulp-cached": "^1.1.0", - "gulp-clean": "^0.3.1", - "gulp-concat": "^2.6.0", - "gulp-file-include": "^0.13.7", - "gulp-htmlmin": "^1.3.0", - "gulp-load-plugins": "^0.8.1", - "gulp-replace": "^0.5.3", - "gulp-uglify": "^1.5.1", - "run-sequence": "^1.0.2", - "through2": "^0.6.3" - }, - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "keywords": [ - "Codelf", - "real-world usage variable names", - "searchcode" - ], - "author": "unbug", - "license": "MIT" -} diff --git a/resources/fonts/Dressedless_Three.svg b/resources/fonts/Dressedless_Three.svg deleted file mode 100644 index 2f254777..00000000 --- a/resources/fonts/Dressedless_Three.svg +++ /dev/null @@ -1,281 +0,0 @@ - - - - -Created by FontForge 20150824 at Mon Dec 21 19:07:26 2015 - By Everything Fonts -Typeface (c) 538Fonts. 2013-PRESENT. All Rights Reserved - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/fonts/Dressedless_Three.ttf b/resources/fonts/Dressedless_Three.ttf deleted file mode 100755 index 90b1ef61..00000000 Binary files a/resources/fonts/Dressedless_Three.ttf and /dev/null differ diff --git a/resources/fonts/FontAwesome.otf b/resources/fonts/FontAwesome.otf deleted file mode 100644 index 3ed7f8b4..00000000 Binary files a/resources/fonts/FontAwesome.otf and /dev/null differ diff --git a/resources/fonts/fontawesome-webfont.eot b/resources/fonts/fontawesome-webfont.eot deleted file mode 100644 index 9b6afaed..00000000 Binary files a/resources/fonts/fontawesome-webfont.eot and /dev/null differ diff --git a/resources/fonts/fontawesome-webfont.svg b/resources/fonts/fontawesome-webfont.svg deleted file mode 100644 index d05688e9..00000000 --- a/resources/fonts/fontawesome-webfont.svg +++ /dev/null @@ -1,655 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/resources/fonts/fontawesome-webfont.ttf b/resources/fonts/fontawesome-webfont.ttf deleted file mode 100644 index 26dea795..00000000 Binary files a/resources/fonts/fontawesome-webfont.ttf and /dev/null differ diff --git a/resources/fonts/fontawesome-webfont.woff b/resources/fonts/fontawesome-webfont.woff deleted file mode 100644 index dc35ce3c..00000000 Binary files a/resources/fonts/fontawesome-webfont.woff and /dev/null differ diff --git a/resources/fonts/fontawesome-webfont.woff2 b/resources/fonts/fontawesome-webfont.woff2 deleted file mode 100644 index 500e5172..00000000 Binary files a/resources/fonts/fontawesome-webfont.woff2 and /dev/null differ diff --git a/resources/images/codelf_logo.png b/resources/images/codelf_logo.png deleted file mode 100644 index 0c969d84..00000000 Binary files a/resources/images/codelf_logo.png and /dev/null differ diff --git a/resources/images/paypal.png b/resources/images/paypal.png deleted file mode 100644 index d5631cff..00000000 Binary files a/resources/images/paypal.png and /dev/null differ diff --git a/resources/images/twohardtings.jpg b/resources/images/twohardtings.jpg deleted file mode 100644 index adfd3e30..00000000 Binary files a/resources/images/twohardtings.jpg and /dev/null differ diff --git a/resources/images/wechatpay.jpg b/resources/images/wechatpay.jpg deleted file mode 100644 index 5d553116..00000000 Binary files a/resources/images/wechatpay.jpg and /dev/null differ diff --git a/resources/images/zhifubao.png b/resources/images/zhifubao.png deleted file mode 100644 index 22125426..00000000 Binary files a/resources/images/zhifubao.png and /dev/null differ diff --git a/src/lib/ZeroClipboard.swf b/src/lib/ZeroClipboard.swf deleted file mode 100755 index 9c2171a2..00000000 Binary files a/src/lib/ZeroClipboard.swf and /dev/null differ diff --git a/src/lib/libs.f851782e.js b/src/lib/libs.f851782e.js deleted file mode 100644 index cdcb731f..00000000 --- a/src/lib/libs.f851782e.js +++ /dev/null @@ -1,11 +0,0 @@ -if(!function(t,e){"object"==typeof module&&"object"==typeof module.exports?module.exports=t.document?e(t,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return e(t)}:e(t)}("undefined"!=typeof window?window:this,function(t,e){function n(t){var e="length"in t&&t.length,n=Z.type(t);return"function"===n||Z.isWindow(t)?!1:1===t.nodeType&&e?!0:"array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t}function i(t,e,n){if(Z.isFunction(e))return Z.grep(t,function(t,i){return!!e.call(t,i,t)!==n});if(e.nodeType)return Z.grep(t,function(t){return t===e!==n});if("string"==typeof e){if(st.test(e))return Z.filter(e,t,n);e=Z.filter(e,t)}return Z.grep(t,function(t){return $.call(e,t)>=0!==n})}function r(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}function o(t){var e=dt[t]={};return Z.each(t.match(pt)||[],function(t,n){e[n]=!0}),e}function a(){Q.removeEventListener("DOMContentLoaded",a,!1),t.removeEventListener("load",a,!1),Z.ready()}function s(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=Z.expando+s.uid++}function u(t,e,n){var i;if(void 0===n&&1===t.nodeType)if(i="data-"+e.replace(wt,"-$1").toLowerCase(),n=t.getAttribute(i),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:bt.test(n)?Z.parseJSON(n):n}catch(r){}yt.set(t,e,n)}else n=void 0;return n}function l(){return!0}function c(){return!1}function f(){try{return Q.activeElement}catch(t){}}function h(t,e){return Z.nodeName(t,"table")&&Z.nodeName(11!==e.nodeType?e:e.firstChild,"tr")?t.getElementsByTagName("tbody")[0]||t.appendChild(t.ownerDocument.createElement("tbody")):t}function p(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function d(t){var e=Rt.exec(t.type);return e?t.type=e[1]:t.removeAttribute("type"),t}function g(t,e){for(var n=0,i=t.length;i>n;n++)vt.set(t[n],"globalEval",!e||vt.get(e[n],"globalEval"))}function m(t,e){var n,i,r,o,a,s,u,l;if(1===e.nodeType){if(vt.hasData(t)&&(o=vt.access(t),a=vt.set(e,o),l=o.events)){delete a.handle,a.events={};for(r in l)for(n=0,i=l[r].length;i>n;n++)Z.event.add(e,r,l[r][n])}yt.hasData(t)&&(s=yt.access(t),u=Z.extend({},s),yt.set(e,u))}}function v(t,e){var n=t.getElementsByTagName?t.getElementsByTagName(e||"*"):t.querySelectorAll?t.querySelectorAll(e||"*"):[];return void 0===e||e&&Z.nodeName(t,e)?Z.merge([t],n):n}function y(t,e){var n=e.nodeName.toLowerCase();"input"===n&&xt.test(t.type)?e.checked=t.checked:("input"===n||"textarea"===n)&&(e.defaultValue=t.defaultValue)}function b(e,n){var i,r=Z(n.createElement(e)).appendTo(n.body),o=t.getDefaultComputedStyle&&(i=t.getDefaultComputedStyle(r[0]))?i.display:Z.css(r[0],"display");return r.detach(),o}function w(t){var e=Q,n=Ht[t];return n||(n=b(t,e),"none"!==n&&n||(Ft=(Ft||Z("