This file contains 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
## Example: Grab the value for the MYSQL_USER key | |
User=$( sed -n 's/.*"MYSQL_USER": "\(.*\)",/\1/p' /var/lib/credentials.json ) | |
## Example: Grab the value for the MYSQL_PASSWORD key | |
Passwd=$( sed -n 's/.*"MYSQL_PASSWORD": "\(.*\)",/\1/p' /var/lib/credentials.json ) |
This file contains 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
These two files should help you to import passwords from mac OS X keychains to 1password. | |
Assumptions: | |
1) You have some experience with scripting/are a power-user. These scripts worked for me | |
but they haven't been extensively tested and if they don't work, you're on your own! | |
Please read this whole document before starting this process. If any of it seems | |
incomprehensible/frightening/over your head please do not use these scripts. You will | |
probably do something Very Bad and I wouldn't want that. | |
2) You have ruby 1.9.2 installed on your machine. This comes as standard with Lion, previous | |
versions of OS X may have earlier versions of ruby, which *may* work, but then again, they |
This file contains 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
<?php | |
class Lunar { | |
var $MIN_YEAR = 1891; | |
var $MAX_YEAR = 2100; | |
var $lunarInfo = array( | |
array(0,2,9,21936),array(6,1,30,9656),array(0,2,17,9584),array(0,2,6,21168),array(5,1,26,43344),array(0,2,13,59728), | |
array(0,2,2,27296),array(3,1,22,44368),array(0,2,10,43856),array(8,1,30,19304),array(0,2,19,19168),array(0,2,8,42352), | |
array(5,1,29,21096),array(0,2,16,53856),array(0,2,4,55632),array(4,1,25,27304),array(0,2,13,22176),array(0,2,2,39632), | |
array(2,1,22,19176),array(0,2,10,19168),array(6,1,30,42200),array(0,2,18,42192),array(0,2,6,53840),array(5,1,26,54568), | |
array(0,2,14,46400),array(0,2,3,54944),array(2,1,23,38608),array(0,2,11,38320),array(7,2,1,18872),array(0,2,20,18800), |
This file contains 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
<?php | |
/* | |
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP) | |
Author: _ck_ (with contributions by GK, stasilok) | |
Version: 0.1.7 | |
Free for any kind of use or modification, I am not responsible for anything, please share your improvements | |
* revision history | |
0.1.7 2015-09-01 regex fix for PHP7 phpinfo | |
0.1.6 2013-04-12 moved meta to footer so graphs can be higher and reduce clutter |
This file contains 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
Apple very usefully provides unauthenticated json feeds for both the iTunes search and iTunes rss | |
The Search API returns your search results in JavaScript Object Notation (JSON) format. JSON is built on two structures: | |
All JSON results are encoded as UTF-8. For more information on JSON, please see http://www.json.org. | |
--- | |
Search API | |
http://www.apple.com/itunes/affiliates/resources/documentation/itunes-store-web-service-search-api.html | |
--- | |
RSS Info |
This file contains 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
// http://ssd.jpl.nasa.gov/txt/aprx_pos_planets.pdf | |
typedef enum{ | |
Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune, Pluto | |
} Planet; | |
// a e I L long.peri. long.node. | |
// AU rad deg deg deg deg | |
static double elements[] = {0.38709927, 0.20563593, 7.00497902, 252.25032350, 77.45779628, 48.33076593, //mercury | |
0.72333566, 0.00677672, 3.39467605, 181.97909950, 131.60246718, 76.67984255, //venus | |
1.00000261, 0.01671123, -0.00001531, 100.46457166, 102.93768193, 0.0, //earth moon barycenter |
This file contains 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
/* | |
Usage: | |
Add a class of "autosubmit" to controls. If the control is not within a form | |
(or even if it is but you want to use a different form), add data-autosubmit-form="#selector". | |
Then, on DOM ready, execute autosubmit() to wire up the handlers: | |
$(function () { | |
autosubmit(); | |
}); |
This file contains 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
#import <UIKit/UIKit.h> | |
#import <AVFoundation/AVFoundation.h> | |
@protocol QRScannerViewControllerDelegate <NSObject> | |
- (void) catch:(NSString*)content; | |
@end | |
@interface QRScannerViewController : UIViewController | |
@property (assign, nonatomic) id<QRScannerViewControllerDelegate> delegate; |
This file contains 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
<?php | |
/* | |
* 经典的概率算法, | |
* $proArr是一个预先设置的数组, | |
* 假设数组为:array(100,200,300,400), | |
* 开始是从1,1000 这个概率范围内筛选第一个数是否在他的出现概率范围之内, | |
* 如果不在,则将概率空间,也就是k的值减去刚刚的那个数字的概率空间, | |
* 在本例当中就是减去100,也就是说第二个数是在1,900这个范围内筛选的。 | |
* 这样 筛选到最终,总会有一个数满足要求。 | |
* 就相当于去一个箱子里摸东西, |
This file contains 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
/** | |
* This is a project designed to get around sites using Cloudflare's "I'm under attack" mode. | |
* Using the PhantomJS headless browser, it queries a site given to it as the second parameter, | |
* waits six seconds and returns the cookies required to continue using this site. With this, | |
* it is possible to automate scrapers or spiders that would otherwise be thwarted by Cloudflare's | |
* anti-bot protection. | |
* | |
* To run this: phantomjs cloudflare-challenge.js http://www.example.org/ | |
* | |
* Copyright © 2015 by Alex Wilson <antoligy@antoligy.com> |
OlderNewer