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
| <#-- dump.ftl | |
| -- | |
| -- Generates tree representations of data model items. | |
| -- | |
| -- Usage: | |
| -- <#import "dump.ftl" as dumper> | |
| -- | |
| -- When used within html pages you've to use <pre>-tags to get the wanted | |
| -- result: | |
| -- <pre> |
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
| /** | |
| * | |
| * > unsplash images downloader | |
| * | |
| * # Installtion | |
| * ~$ npm install jsdom | |
| * | |
| * # Usage | |
| * ~$ node unsplash.js | |
| */ |
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 | |
| RCol='\033[0m' # Text Reset | |
| # Regular Bold Underline High Intensity BoldHigh Intens Background High Intensity Backgrounds | |
| Bla='\033[0;30m'; BBla='\033[1;30m'; UBla='\033[4;30m'; IBla='\033[0;90m'; BIBla='\033[1;90m'; On_Bla='\033[40m'; On_IBla='\033[0;100m'; | |
| Red='\033[0;31m'; BRed='\033[1;31m'; URed='\033[4;31m'; IRed='\033[0;91m'; BIRed='\033[1;91m'; On_Red='\033[41m'; On_IRed='\033[0;101m'; | |
| Gre='\033[0;32m'; BGre='\033[1;32m'; UGre='\033[4;32m'; IGre='\033[0;92m'; BIGre='\033[1;92m'; On_Gre='\033[42m'; On_IGre='\033[0;102m'; | |
| Yel='\033[0;33m'; BYel='\033[1;33m'; UYel='\033[4;33m'; IYel='\033[0;93m'; BIYel='\033[1;93m'; On_Yel='\033[43m'; On_IYel='\033[0;103m'; | |
| Blu='\033[0;34m'; BBlu='\033[1;34m'; UBlu='\033[4;34m'; IBlu='\033[0;94m'; BIBlu='\033[1;94m'; On_Blu='\033[44m'; On_IBlu='\033[0;104m'; |
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
| #!/usr/bin/env bash | |
| BIN_NODE=/usr/local/bin/node | |
| # remove link file first . | |
| if [[ -h $BIN_NODE ]]; then | |
| rm -f /usr/local/bin/node | |
| fi | |
| TARGET_NODE=`which $1` |
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
| /** | |
| * sort method | |
| */ | |
| String.prototype.sort = function(){ | |
| return this | |
| .split('') | |
| .sort() | |
| .join(''); | |
| }; | |
| /** |
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 gulp = require('gulp'); | |
| var less = require('gulp-less'); | |
| var jade = require('gulp-jade'); | |
| var express = require('express'); | |
| var static = require('express-static'); | |
| gulp.task('default', [ 'less', 'jade', 'copy', 'watch', 'server' ]); | |
| gulp.task('less', function(){ |
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(){ |
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
| 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
| -- iMessage Spam报告自动化脚本 spamshot by ashfinal | |
| (* | |
| 使用方法: | |
| 如果你需要扫描举报已有的垃圾信息(数量较多),请通过脚本编辑器直接运行该脚本(快捷键为⌘+R)。 | |
| 如果想每当接收到垃圾信息时自动弹窗举报,请按照以下设置: | |
| 1. 打开Messages设置-General-AppleScript handler,下拉框选择"Open Scripts Folder"; | |
| 2. 把该脚本扔到打开的Finder窗口,再到刚才的Messages设置里选择该脚本; | |
| 3. 到控制面板-隐私与安全-Privacy-Accessibility里面点加号手动添加iMessages.app的辅助控制权限; |