Skip to content

Instantly share code, notes, and snippets.

@oldj
oldj / GA.py
Last active July 2, 2023 09:26
py-TSP
# -*- coding: utf-8 -*-
"""GA.py
遗传算法类
"""
import random
from Life import Life
@wh1t3p1g
wh1t3p1g / ctf古典密码集合
Last active March 26, 2024 05:51
古典密码集合
下述密码均摘自互联网
【字母表顺序】-数字 
  加密的时候,经常要把A~Z这26个字母转换成数字,最常见的一种方法就是取字母表中的数字序号。A代表1,B代表2,C代表3... 
  字母 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 
  数字 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 
@darcyliu
darcyliu / install_spark_centos7.sh
Created April 1, 2016 09:40
Install Spark on CentOS 7
#!/bin/bash
# Install Spark on CentOS 7
yum install java -y
java -version
yum install wget -y
wget http://downloads.typesafe.com/scala/2.11.7/scala-2.11.7.tgz
tar xvf scala-2.11.7.tgz
sudo mv scala-2.11.7 /usr/lib
sudo ln -s /usr/lib/scala-2.11.7 /usr/lib/scala
@manxisuo
manxisuo / sqlite3-jdbc.properties
Last active June 12, 2017 02:37
MyBatis使用SQLite3配置
# 数据库驱动
jdbc.driver=org.sqlite.JDBC
# 数据库文件位置(数据库文件为little.db,位于类路径下)
jdbc.url=jdbc:sqlite::resource:little.db
# 用户名(默认root)
jdbc.username=root
# 密码(默认root)
@abrasumente233
abrasumente233 / nesign.py
Last active June 26, 2022 01:46
网易云音乐签到(pc android)
# -*- coding: utf-8 -*-
"""网易云自动签到"""
import requests
__author__ = 'abrasumente'
@acgotaku
acgotaku / image.py
Created October 5, 2015 14:21
Histogram_equalization
#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
import os
import sys
from PIL import Image
import numpy as np
def read(imgPath):
img = Image.open(imgPath)
img = img.convert("L")
@qas612820704
qas612820704 / studenpackfree.md
Last active February 28, 2022 15:11
用學生信箱申請github提供的免費資源申請雲端主機(DigitalOcean+namecheap)

用學生信箱申請github提供的免費資源申請雲端主機(DigitalOcean+namecheap)

現在 github 有提出一系列對學生的優惠服務 詳情請點這裡

只要你是學生(擁有內含edu的信箱 ex:XXXXXX@mail.nchu.edu.tw)

如果你是學生又是黑客的話,就讓我們來申請吧!

Part I Get Student pack

@apprentice1988
apprentice1988 / 升级npm 和node的shell 命令
Last active February 15, 2017 03:42
升级 npm 和 node 版本
sudo npm update npm -g
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
@lrhache
lrhache / python-selenium-open-tab.md
Last active June 10, 2023 13:49
Python Selenium - Open new tab / focus tab / close tab

On a recent project, I ran into an issue with Python Selenium webdriver. There's no easy way to open a new tab, grab whatever you need and return to original window opener.

Here's a couple people who ran into the same complication:

So, after many minutes (read about an hour) of searching, I decided to do find a quick solution to this problem.