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
  • 14:24 (UTC +01:00)
View GitHub Profile
@fonic
fonic / python_argparse_custom_help_usage.py
Last active September 30, 2024 10:37
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 August 22, 2024 10:12
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 {