Skip to content

Instantly share code, notes, and snippets.

View mrsof's full-sized avatar
💭
I may be slow to respond.

Sof mrsof

💭
I may be slow to respond.
  • France
  • 17:51 (UTC +02:00)
View GitHub Profile
@fonic
fonic / python_argparse_custom_help_usage.py
Last active April 10, 2024 17:14
Python module extending class 'argparse.ArgumentParser' to support custom help/usage output (incl. example/demo)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# -------------------------------------------------------------------------
# -
# Python Module Argument Parser -
# -
# Created by Fonic <https://github.com/fonic> -
# Date: 06/20/19 - 04/03/24 -
# -
@kingspp
kingspp / logging.py
Created April 22, 2017 07:14
Python Comprehensive Logging using YAML Configuration
import os
import yaml
import logging.config
import logging
import coloredlogs
def setup_logging(default_path='logging.yaml', default_level=logging.INFO, env_key='LOG_CFG'):
"""
| **@author:** Prathyush SP
| Logging Setup
@adamreisnz
adamreisnz / package.json
Last active January 19, 2024 13:01
Simple pure npm scripts build process
{
"name": "project-name",
"description": "Template for static sites",
"version": "1.0.0",
"homepage": "http://www.project-name.com",
"author": {
"name": "Adam Reis",
"url": "http://adam.reis.nz"
},
"license": "UNLICENSED",
@niczak
niczak / gist:2501891
Created April 26, 2012 18:48
PHP Encrypt/Decrypt Class
<?php
class Encryption {
var $skey = "yourSecretKey"; // change this
public function safe_b64encode($string) {
$data = base64_encode($string);
$data = str_replace(array('+','/','='),array('-','_',''),$data);
return $data;
}
@Mononofu
Mononofu / share.css
Created March 15, 2012 18:59
socialshareprivacy inline, without jQuery
.social_share_privacy_area {
clear: both;
margin: 20px 0 !important;
list-style-type: none;
padding: 0 !important;
width: auto;
height: 25px;
display: block;
}
.social_share_privacy_area li {