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
| <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
| /** | |
| * | |
| * 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
| 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
| { | |
| "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
| #!/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
| _.mixin({ | |
| // Return a copy of the object containing all but the blacklisted properties. | |
| unpick: function (obj) { | |
| return _.pick(obj, _.difference(_.keys(obj), _.flatten(Array.prototype.slice.call(arguments, 1)))); | |
| }, | |
| average: function (arr) { | |
| return _.reduce(arr, function(memo, num){ | |
| return memo + num; | |
| }, 0) / arr.length; | |
| } |
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 | |
| # ~$ ./auto-like.sh AWjSRV4NJ6K1UqL9m4KiH-yf | |
| # ~$ like OK | |
| SID=$1 | |
| URL="http://ish.z.qq.com/infocenter_v2.jsp?sid=$SID" | |
| echo $URL | |
| LIKE_URL=`curl -s $URL | grep -o 'http://[^"]*' | grep like_action | sed 's/amp;//g'` |
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 | |
| LATEST_URL="http://nginx.org/download/nginx-1.6.2.tar.gz" | |
| sudo apt-get update | |
| sudo apt-get install libssl-dev | |
| sudo apt-get install zlibc zlib1g zlib1g-dev | |
| wget $LATEST_URL -O /tmp/nginx-latest |
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
| <!-- put file in your html --> | |
| <script src="../common/forms/gh-pattern.js"></script> | |
| <script src="../common/forms/gh-unique.js"></script> | |
| <!-- require javascript to app --> | |
| <script type="text/javascript"> | |
| angular.module('ghValidation', [ 'ghPattern' ,'ghUnique' ]); | |
| </script> | |
| <!-- |