Skip to content

Instantly share code, notes, and snippets.

@hailiang-wang
hailiang-wang / mmseg_example.py
Created July 19, 2017 18:16
基于MMSEG中文分词算法的 Python3 实现
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#===============================================================================
#
# Copyright 2017 Hai Liang Wang <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
@makenova
makenova / IMfromsource.md
Last active November 3, 2020 22:33
Install ImageMagick from source on Ubuntu 14.04

Install ImageMagick from source on Ubuntu 14.04

Note

These notes were for a job I am no longer at and are very dated. Please go to the imagemagick website for updated instructions.

The version of ImageMagick that is installed when you run apt-get install imagemagick on Ubuntu 14.04 is older than I would like.

$ convert --version
@sj26
sj26 / LICENSE.md
Last active August 26, 2025 22:35
Bash retry function

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit

@samoshkin
samoshkin / heathrow-to-london.hs
Created December 4, 2016 23:12
Algorithm to find best path from Heathrow to London. Exercise is taken from the book "Learn you a Haskell"
{-
Implementation of "Heathrow to London" algorithm
from a task in the book "Learn you a Haskell"
http://learnyouahaskell.com/functionally-solving-problems
Example input:
```
$ echo "50 10 30 5 90 20 40 2 25 10 8 0 " | tr ' ' '\n' | runhaskell heathrow-to-london.hs
```
@pragnesh
pragnesh / EfficientThreadPoolExecutor
Created September 25, 2016 06:15 — forked from akshaydeo/EfficientThreadPoolExecutor
EfficientThreadPoolExecutor
/**
* Thread pool executor
* Author: akshay
* Date : 9/30/13
* Time : 2:55 PM
*/
public class EfficientThreadPoolExecutor extends ThreadPoolExecutor {
/**
* Logger
@Fleshgrinder
Fleshgrinder / ssmtp-debian-setup.md
Last active July 12, 2024 18:09
Set up sSMTP on Debian as replacement for sendmail and usage with PHP

sSMTP Debian Setup

The sendmail package, which comes preinstalled with many distros, is often simply too much for a simple server that should not receive emails but rather deliver them. The sSMTP package is a lightweight replacement that does not set up regular cronjobs and only reacts if a subsystem actually wants to send a mail.

Uninstall Sendmail

apt-get purge --yes sendmail*
@kanibaspinar
kanibaspinar / my.cnf
Last active August 13, 2025 06:21
Mysql My.cnf Optimization - Best Performance For 1000 + Sites Web Server
# Optimized MySQL configuration for cPanel servers by Kani Baspinar - Updated June 2016
#
# The settings provided below are a starting point for a 24GB RAM server with 8 CPU cores.
# If you have less or more resources available you MUST adjust accordingly to save CPU, RAM and disk I/O usage.
# To fine tune these settings for your system, use MySQL DB diagnostics tools like:
# Test your configuration ; https://launchpad.net/mysql-tuning-primer
# or
# http://blog.mysqltuner.com/download/
# Note that if there is NO comment beside a setting, then you don't need to adjust it.
#
@METACEO
METACEO / README.md
Last active July 1, 2016 19:11 — forked from plugnburn/README.md
XTF.js - DOM construction / templating / manipulation library in 24 lines of JS, 478 bytes minified

XTF.js

This extends the ultra-small, array-based templating library XT.js with functional manipulation abilities. This extension adds to xtf.js 6 lines of code and to xtf.min.js 155 minified bytes.

How to obtain

Download the minified version here or include it into your code:

@lanefu
lanefu / OrangePIPythonWiringPIBuild.md
Last active July 31, 2024 22:22
How to get wiring Pi Python libraries on Orange PI with armbian

Overview

Use my fork of the Wiring-Pi Python library which checks out the WiringOP fork of the WiringPi library as a submodule to build everything. yes that's a little confusing

The WiringPI library is the original C library that RaspGPIO is somewhat based on. WiringPi was built to replicate arduino GPIO functions

In Raspberry Pi Land there are 2 normal python paths for GPIO. One is Raspi.GPIO and the other is WiringPI

Known Success

@mbejda
mbejda / openssl.ssh
Created April 12, 2016 12:37
Installing OpenSSL 1.0.2 on Ubuntu 14
openssl version -a
sudo add-apt-repository ppa:0k53d-karl-f830m/openssl
sudo apt-get update
sudo apt-get install openssl
openssl version -a