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
| function load_geetest_img(slices){ | |
| return new Promise((resolve, reject)=>{ | |
| var img = new Image(); | |
| img.crossOrigin = "Anonymous"; | |
| img.onload = ()=>{resolve(img)}; | |
| img.src = slices[0].style.backgroundImage.slice(4, -1); | |
| }); | |
| } | |
| var restore_image = function(img, slices){ |
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
| def delete_matching_regexp(dir, regex) | |
| Dir.entries(dir).each do |name| | |
| path = File.join(dir, name) | |
| if name =~ regex | |
| ftype = File.directory?(path) ? Dir : File | |
| begin | |
| ftype.delete(path) | |
| rescue SystemCallError => e | |
| $stderr.puts e.message | |
| end |
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
| """Kernel K-means""" | |
| # Author: Mathieu Blondel <mathieu@mblondel.org> | |
| # License: BSD 3 clause | |
| import numpy as np | |
| from sklearn.base import BaseEstimator, ClusterMixin | |
| from sklearn.metrics.pairwise import pairwise_kernels | |
| from sklearn.utils import check_random_state |
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
| #### Jekyll Layout: /_layouts/.htaccess | |
| # Apache Configuration File | |
| {% if ((page.auth_dir.users != empty) or (page.auth_dir.groups != empty)) %} | |
| AuthName "Privater Bereich" | |
| AuthType Basic | |
| # => mehrere Require Blocks werden geodert: http://d43.me/blog/1157 | |
| AuthzUserAuthoritative Off | |
| AuthUserFile {{ page.auth_remote_user_file }} |
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
| from pybloom import BloomFilter | |
| from scrapy.utils.job import job_dir | |
| from scrapy.dupefilter import BaseDupeFilter | |
| class BLOOMDupeFilter(BaseDupeFilter): | |
| """Request Fingerprint duplicates filter""" | |
| def __init__(self, path=None): | |
| self.file = None | |
| self.fingerprints = BloomFilter(2000000, 0.00001) |
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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
NewerOlder