Skip to content

Instantly share code, notes, and snippets.

View leiless's full-sized avatar
๐ŸŽฏ
Focusing

Fishboneยฐ leiless

๐ŸŽฏ
Focusing
  • China
  • 02:31 (UTC +08:00)
View GitHub Profile
@ThomasChiroux
ThomasChiroux / version.py
Last active November 22, 2021 11:50
get mercurial (hg) current version on a repo (last tag and rev number)
# -*- coding: utf-8 -*-
"""get version number from dvcs
"""
from subprocess import Popen, PIPE
def get_hg_version():
"""uses mercurial to get last tag and last revision number
@cosimo
cosimo / parse-options.sh
Created September 21, 2012 09:31
Example of how to parse options with bash/getopt
#!/bin/bash
#
# Example of how to parse short/long options with 'getopt'
#
OPTS=`getopt -o vhns: --long verbose,dry-run,help,stack-size: -n 'parse-options' -- "$@"`
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi
echo "$OPTS"
@fcicq
fcicq / adler32.py
Created December 5, 2012 10:49
Rsync Rolling Hash (Adler-32)
# modified from pysync
_BASE=65521 # largest prime smaller than 65536
_NMAX=5552 # largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1
_OFFS=1 # default initial s1 offset
# fcicq: _NMAX is embedded in zlib's adler32 for one pass calculation,
# and we mainly do the rolling hash, so _NMAX is not used here.
import zlib
class adler32:
def __init__(self,data=''):
@boredzo
boredzo / Untitled.out
Created December 18, 2012 05:30
Testing NSString compare:options:range: with a prefix range that is equal in both strings
2012-12-17 21:27:34.211 Untitled[10696:707] -1
2012-12-17 21:27:34.219 Untitled[10696:707] 0
@turbidsoul
turbidsoul / Base16.java
Created March 23, 2013 08:28
java base 16 ็ผ–็ ๅ’Œ่งฃ็ 
/***
* Copyright 2006 [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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations
@bodokaiser
bodokaiser / Makefile
Last active April 2, 2025 12:39
Example of how to use libuv`s QUEUE.
build:
$(CC) -o queue.o queue.c
@h7deaux
h7deaux / conky.rc
Last active November 9, 2022 03:40
Conky System Tray Bar
# Use Xft?
use_xft yes
xftfont DejaVu Sans:size=8
xftalpha 1
text_buffer_size 2048
#bar size
default_bar_size 25 5
# Update interval in seconds
@javiermon
javiermon / LICENSE
Last active July 8, 2024 06:36
get default gateway
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
@rxaviers
rxaviers / gist:7360908
Last active October 27, 2025 08:49
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: ๐Ÿ˜„ :smile: ๐Ÿ˜† :laughing:
๐Ÿ˜Š :blush: ๐Ÿ˜ƒ :smiley: โ˜บ๏ธ :relaxed:
๐Ÿ˜ :smirk: ๐Ÿ˜ :heart_eyes: ๐Ÿ˜˜ :kissing_heart:
๐Ÿ˜š :kissing_closed_eyes: ๐Ÿ˜ณ :flushed: ๐Ÿ˜Œ :relieved:
๐Ÿ˜† :satisfied: ๐Ÿ˜ :grin: ๐Ÿ˜‰ :wink:
๐Ÿ˜œ :stuck_out_tongue_winking_eye: ๐Ÿ˜ :stuck_out_tongue_closed_eyes: ๐Ÿ˜€ :grinning:
๐Ÿ˜— :kissing: ๐Ÿ˜™ :kissing_smiling_eyes: ๐Ÿ˜› :stuck_out_tongue:
@azadkuh
azadkuh / OpenSSL cheat sheet for socket programmers.md
Last active September 16, 2025 08:11
OpenSSL cheat sheet. This is a brief howto for socket programmers.

#OpenSSL cheat sheet This is a brief howto for socket programmers.

create RSA key pairs

ex: 1024bits length key pair:

$> openssl genrsa -out myprivate.pem 1024
$> openssl rsa -in myprivate.pem -pubout -out mypublic.pem