Skip to content

Instantly share code, notes, and snippets.

View chenkovsky's full-sized avatar

Chongchen Chen chenkovsky

  • Fudan
  • Shanghai
View GitHub Profile
@chenkovsky
chenkovsky / 0_reuse_code.js
Last active August 29, 2015 14:06
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@chenkovsky
chenkovsky / bloomdupefilter.py
Last active May 8, 2020 03:48
scrapy configure
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)
@chenkovsky
chenkovsky / .htaccess
Last active August 29, 2015 14:06 — forked from snrbrnjna/.htaccess
#### 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 }}
"""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
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
@chenkovsky
chenkovsky / crack_geetest.js
Last active March 29, 2017 06:22
crack_geetest
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){
@chenkovsky
chenkovsky / web-servers.md
Created November 17, 2017 07:21 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000

Ref: https://gist.github.com/vertexclique/9839383

For 3143 build 2017.09.14

VERSION PLATFORM OFFSET ORIGINAL CRACKED
3143 macOS 0x65D4 55 C3
3143   macOS   0x6219 55       C3    
3143 macOS   0x75214 55 48 89 E5 41 57 41 56 48 C7 C0 01 00 00 00 C3
@chenkovsky
chenkovsky / fasttext_lid_training.sh
Created January 12, 2018 04:44 — forked from loretoparisi/fasttext_lid_training.sh
FastText Language Detection - Training on macOS
#!bin/bash
# grab labeled dataset
wget http://downloads.tatoeba.org/exports/sentences.tar.bz2
bunzip2 sentences.tar.bz2
tar xvf sentences.tar
# macos only for gshuf
brew install coreutils
awk -F"\t" '{print"__label__"$2" "$3}' < sentences.csv | gshuf > all.txt
@chenkovsky
chenkovsky / cracking.md
Created May 17, 2018 03:01
Commands to license your version of Sublime Text 3.

Sublime Text 3 is a very popular text editor among developers. It is provided for free, but every few saves, you get a popup asking you to purchase Sublime Text for $80.

The Popup

Now this is a wonderful piece of software, but not everyone has the $80+ to purchase a license for Sublime Text. However, I strongly recommend to eventually buy a license if you have the money to spare to support the development of ST.

Now, let's get into the cracking

Note: At the license prompt for MacOS, enter in any garbage, even a single letter and click Use License.