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
| #!/bin/bash | |
| mount_disk() | |
| { | |
| sudo umount $disk | |
| mkdir ~/Desktop/$diskname | |
| sudo mount_ntfs -o rw,auto,nodev,nobrowse,noowners,noatime $disk ~/Desktop/$diskname | |
| echo "Mount $disk to ~/Desktop/$diskname" | |
| open ~/Desktop/$diskname | |
| } |
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
| { | |
| "name": "weipai-downloader", | |
| "version": "1.0.0", | |
| "description": "", | |
| "main": "weipai.js", | |
| "author": "lsong", | |
| "license": "MIT", | |
| "dependencies": { | |
| "async": "^0.9.0", | |
| "download": "^3.1.2", |
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
| var MethodProfiler = function(component) { | |
| this.component = component; | |
| this.timers = {}; | |
| this.log = document.createElement("ul"); | |
| var body = document.body; | |
| document.getElementById("result").appendChild(this.log); | |
| for(var key in this.component) { | |
| // Ensure that the property is a function. | |
| if(typeof this.component[key] !== 'function') { | |
| continue; |
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
| /** | |
| * | |
| * Base64 encode / decode | |
| * http://www.webtoolkit.info/ | |
| * | |
| **/ | |
| var Base64 = { | |
| // private property |
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
| <html> | |
| <head> | |
| <title>Dependency injection Demo</title> | |
| <script charset="utf-8"> | |
| /** | |
| * [依赖注入核心定义] | |
| * @param {[type]} win [description] | |
| * @param {[type]} undefined [description] | |
| * @return {[type]} [description] | |
| */ |
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 <math.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #define PI 3.14159265359 | |
| float sx, sy; | |
| float sdCircle(float px, float py, float r) { | |
| float dx = px - sx, dy = py - sy; |
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
| -- iMessage Spam报告自动化脚本 spamshot by ashfinal | |
| (* | |
| 使用方法: | |
| 如果你需要扫描举报已有的垃圾信息(数量较多),请通过脚本编辑器直接运行该脚本(快捷键为⌘+R)。 | |
| 如果想每当接收到垃圾信息时自动弹窗举报,请按照以下设置: | |
| 1. 打开Messages设置-General-AppleScript handler,下拉框选择"Open Scripts Folder"; | |
| 2. 把该脚本扔到打开的Finder窗口,再到刚才的Messages设置里选择该脚本; | |
| 3. 到控制面板-隐私与安全-Privacy-Accessibility里面点加号手动添加iMessages.app的辅助控制权限; |
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
| app.factory 'CustomHttp', ($q)-> | |
| (originHttpPromise)-> | |
| deferred = $q.defer() | |
| originHttpPromise | |
| .success (data)-> | |
| deferred.resolve data | |
| .error (err)-> | |
| deferred.reject err | |
| deferred.promise |
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
| /** | |
| * Created by solomon on 15/1/14. | |
| */ | |
| +function () { | |
| angular.module('ui.router') | |
| .provider('$otherwise', function ($urlRouterProvider) { | |
| var url = ''; | |
| this.path = function (url) { | |
| $urlRouterProvider.otherwise(function ($injector, $location) { | |
| $('body>[ui-view]').html(''); |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Maps</title> | |
| <script src="http://maps.googleapis.com/maps/api/js"></script> | |
| <script type="text/javascript"> | |
| google.maps.event.addDomListener(window, 'load', function(){ | |
| var googleMap = document.getElementById("googleMap") | |
| var xhr = new XMLHttpRequest(); | |
| xhr.onreadystatechange = function(){ |