Skip to content

Instantly share code, notes, and snippets.

@charlesmchen
charlesmchen / hn_seach.js
Created June 8, 2016 15:43 — forked from kristopolous/hn_seach.js
hn job query search
function query() {
var
// HN is done with very unsemantic classes.
job_list = Array.prototype.slice.call(document.querySelectorAll('.c5a,.cae,.c00,.c9c,.cdd,.c73,.c88')),
query_list = Array.prototype.slice.call(arguments),
shown = 0, total = job_list.length;
// Traverses up the dom stack trying to find a match of a specific class
function up_to(node, klass) {
if (node.className === klass) {
Hi there
PaperByFiftyThree://creations/12345
PaperByFiftyThree://users/12345
UIImage *image = [UIImage imageNamed:@"Images/thun-stockhornkette-1904 1600.jpg"];
UIImageView *background = [[UIImageView alloc] initWithImage:image];
[demoModel.rootView addSubviewWithCustomLayout:[[background setStretches]
setIgnoreDesiredSize]];
UIImage *image = [UIImage imageNamed:@"Images/thun-stockhornkette-1904 1600.jpg"];
UIImageView *background = [[UIImageView alloc] initWithImage:image];
WeView *backgroundWrapper = [[WeView alloc] init];
[[backgroundWrapper addSubviewWithFillLayoutWAspectRatio:background]
setVAlign:V_ALIGN_TOP];
// The background will exceed the backgroundWrapper's bounds, so we need to clip.
backgroundWrapper.clipsToBounds = YES;
[demoModel.rootView addSubviewWithCustomLayout:[backgroundWrapper setStretches]];
WeView *pillboxButtonsView = [[WeView alloc] init];
pillboxButtonsView.layer.cornerRadius = 5.f;
pillboxButtonsView.clipsToBounds = YES;
[pillboxButtonsView addSubviewsWithHorizontalLayout:@[
[self createFlatUIPillboxButton:@"Prev"],
[self createFlatUIPillboxSpacer],
[self createFlatUIPillboxButton:@"Details"],
[self createFlatUIPillboxSpacer],
[self createFlatUIPillboxButton:@"Next"],
]];
UIActivityIndicatorView *activityIndicatorView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
[activityIndicatorView startAnimating];
[rootView addSubviewWithCustomLayout:activityIndicatorView];
WeView *rootView = [[WeView alloc] init];
WeView *headerView = [[WeView alloc] init];
headerView.backgroundColor = [UIColor colorWithWhite:0.5f alpha:0.5f];
headerView.opaque = NO;
[[headerView addSubviewWithCustomLayout:[DemoFactory createLabel:@"Ferdinand Hodler"
fontSize:20.f]]
setMargin:5];
[[[[headerView addSubviewWithCustomLayout:[DemoFactory buttonWithImageName:@"Glyphish_Icons/14-tag.png"]]
setHMargin:10]
setVMargin:5]
setHAlign:H_ALIGN_RIGHT];
@charlesmchen
charlesmchen / github.com.js
Created October 24, 2013 17:30
dotjs file to manipulate github content width.
$('div[class=container]').css({'width': '1200px'})
$('div[class^=repository-content]').css({'width': '1140px'})