Skip to content

Instantly share code, notes, and snippets.

View decoda's full-sized avatar
:octocat:
nothing happend

decoda decoda

:octocat:
nothing happend
  • gz
View GitHub Profile
@sotex
sotex / C++判断点是否在多边形内.cpp
Created November 12, 2019 07:40
C++判断点是否在多边形内
#include <iostream>
using namespace std;
struct Point {
double m_x;
double m_y;
};
bool pointInPolygon( Point point, Point* vs, int length )
@chanjarster
chanjarster / nginx.conf
Created December 29, 2017 02:38
Nginx反向代理具有WebSocket应用的配置文件
http {
// ssl 相关配置 ...
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 8020;
@Yaoshicn
Yaoshicn / install-erlang-on-raspberry-pi-3.md
Last active April 26, 2019 22:52
Install Erlang on Raspberry Pi 3

Dependencies

The libwxbase2.8/libqt5/libgtk2.0-dev could be installed for insurance.

# for erlang
sudo apt-get install fop 
sudo apt-get install libncurses5-dev
sudo apt-get install openjdk-6-jdk
sudo apt-get install unixodbc-dev
sudo apt-get install g++
@dschep
dschep / raspbian-python3.6.rst
Last active October 7, 2025 10:31 — forked from BMeu/raspbian-python3.5.rst
Installing Python 3.6 on Raspbian

Installing Python 3.6 on Raspbian

As of January 2018, Raspbian does not yet include the latest Python release, Python 3.6. This means we will have to build it ourselves, and here is how to do it. There is also an ansible role attached that automates it all for you.

  1. Install the required build-tools (some might already be installed on your system).
@samklr
samklr / install-proto.sh
Created April 20, 2015 08:19
Install Protobuf debian ...
#! /bin/bash
wget https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gz
tar xzf protobuf-2.6.1.tar.gz
cd protobuf-2.6.1
sudo apt-get update
sudo apt-get install build-essential
sudo ./configure
sudo make
sudo make check
sudo make install
@lihb
lihb / tab&space.md
Created April 24, 2014 13:50
vim 空格和tab相互转换

vimrc文件中,添加以下代码,然后重启vim,即可实现按tab键产生4个空格:

set ts=4  " ts是tabstop的缩写,设TAB宽4个空格
set expandtab

对于已保存的文件,可以使用如下方法进行空格和TAB的替换:

TAB替换成空格

@smpallen99
smpallen99 / constants.ex
Created April 5, 2014 18:22
Approach for constants shared between modules in Elixir
defmodule Constants do
@moduledoc """
An alternative to use @constant_name value approach to defined reusable
constants in elixir.
This module offers an approach to define these in a
module that can be shared with other modules. They are implemented with
macros so they can be used in guards and matches
## Examples:
@enricodeleo
enricodeleo / my.cnf
Created March 1, 2014 14:15
MySQL optimized my.cnf for Magento store on 1GB ram VPS
[mysqld]
# GENERAL #
user = mysql
default-storage-engine = InnoDB
socket = /var/lib/mysql/mysql.sock
pid-file = /var/lib/mysql/mysql.pid
# MyISAM #
key-buffer-size = 32M
@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active May 4, 2026 20:38
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@seriyps
seriyps / email.erl
Last active November 6, 2022 02:03
Send emails using Erlang gen_smtp shortcut.
% Send plaintext email using gen_smtp https://github.com/Vagabond/gen_smtp
% This function sends email directly to receiver's SMTP server and don't use MTA relays.
%
% Example plaintext email:
% Mail = mail_plain(<<"Bob <sender@example.com>">>, <<"Alice <receiver@example.com>">>, <<"The mail subject">>, <<"The mail body">>),
% send_email(Mail).
%
% Example email with image attachment:
% ImgName = "image.jpg",
% {ok, ImgBin} = file:read_file(ImgName),