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
// PhantomJS script | |
// Takes screeshot of a given page. This correctly handles pages which | |
// dynamically load content making AJAX requests. | |
// Instead of waiting fixed amount of time before rendering, we give a short | |
// time for the page to make additional requests. | |
// Origin https://github.com/kimmobrunfeldt/url-to-image/blob/master/src/url-to-image.js | |
// Phantom internals |
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 system = require("system") | |
var webserver = require("webserver") | |
var webpage = require("webpage") | |
var port = '8001'; | |
var blockedRes = [ | |
"google-analytics.com", | |
"api.mixpanel.com", | |
"fonts.googleapis.com", | |
"stats.g.doubleclick.net", | |
"mc.yandex.ru", |
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
create table tempUrls like urls; | |
insert into tempUrls; | |
select * from urls where id < 100; | |
delete from urls where id < 100 limit 50; | |
alter table urls REBUILD PARTITION p000; | |
alter table urls ANALYZE PARTITION p000; | |
insert ignore into urls select * from tempUrls; | |
drop table tempUrls; |
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 PRINT = false; | |
var LOG = 1; | |
var SEL = ".pin"; | |
var COND = function($node) { | |
var ret = true; | |
ret = checkNum($node, ".pinPrice", ">=", 10); | |
if (!ret) { return false; } |
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/sh | |
# script for batch running sysbench I/O tests for mysql workload | |
# http://www.mysqlperformanceblog.com/2009/08/06/ec2ebs-single-and-raid-volumes-io-bencmark/ | |
set -u | |
set -x | |
set -e | |
for size in 256M 16G; do |
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 | |
# -------------------------------- | |
# Totally Simple Web Server (TSWS) | |
# -------------------------------- | |
# | |
# (c) 2015 Dave Fletcher | |
# All Rights Reserved | |
# | |
# This is free and unencumbered software released into the public domain. |
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
import org.nd4j.linalg.api.ndarray.INDArray; | |
import org.nd4j.linalg.api.ops.BaseAccumulation; | |
import org.nd4j.linalg.api.ops.impl.accum.distances.EuclideanDistance; | |
import org.nd4j.linalg.dataset.api.DataSet; | |
import org.nd4j.linalg.factory.Nd4j; | |
/** | |
* Requires RC1<br/> | |
* This is a sample implementation of K-Nearest Neighbor. KNN doesn't create a latent/hidden model, nor does it train. It simply uses it's dataset as a look up table. | |
* Then grabs the closest k data point/records. From there it is able to look at the labels for the K nearest neighbors and make a decision on what label to predict the incoming |
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
<?php | |
/* | |
Plugin Name: On-Demand image resizer | |
Plugin URI: http://www.monkeyman.be | |
Description: Create and store images in different sizes on demand | |
Version: 1.0 | |
Author: Jan Fabry | |
This plugins monitors 404 requests to the uploads directory and created new images of a requested size. They are saved as new files in the upload directory, not cached somewhere, so future requests are served directly by the server. This allows you to eliminate the creation of intermediate image sizes [see monkeyman-virtual-intermediate-images] or resize images based on the size used in the editor [see monkeyman-resize-image-tags]. |
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
// Just before switching jobs: | |
// Add one of these. | |
// Preferably into the same commit where you do a large merge. | |
// | |
// This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
// and then it quickly escalated into more and more evil suggestions. | |
// I've tried to capture interesting suggestions here. | |
// | |
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
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
auth_mechanisms = plain login digest-md5 cram-md5 ntlm apop | |
!include auth-sql.conf.ext |