Skip to content

Instantly share code, notes, and snippets.

@cristiroma
cristiroma / htaccess
Created March 27, 2017 08:10
.htaccess file for production
FileETag MTime Size
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access 1 month"
ExpiresByType text/html "access 1 month"
# CSS
ExpiresByType text/css "access 1 year"
ExpiresByType application/javascript "access 1 year"
@devfraga
devfraga / modelo.md
Created May 6, 2024 21:58
Modelo contato freela

Modelo e-mail

Modelo 1


Assunto: Alcance mais clientes para sua empresa de forma eficaz.

Olá [Nome do Proprietário] ou [Empresa],

@mdonkers
mdonkers / server.py
Last active May 6, 2024 23:32
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
License: MIT License
Copyright (c) 2023 Miel Donkers
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
@liam-russell
liam-russell / Readme.md
Last active May 6, 2024 23:30
TP-Link Kasa Smart Plug - get energy consumption statistics as a CSV file

TP-Link Kasa Smart Plug - get energy consumption statistics as a CSV file

Background

The TP Link Kasa smart switches log energy consumption data over time, however the app is very limited and won't let you get out data, graph it or see historical usage. This script extracts and saves to a CSV file.

The python-kasa library is used to communicate with the Kasa switch.

Requirements

  • Python must be installed
  • You must be on the same wifi network as the Kasa switch
@russellmcc
russellmcc / fish.el
Last active May 6, 2024 23:29
How to use fish shell paths from emacs
(let*
((fish-path (shell-command-to-string "/opt/homebrew/bin/fish -i -c \"echo -n \\$PATH[1]; for val in \\$PATH[2..-1];echo -n \\\":\\$val\\\";end\""))
(full-path (append exec-path (split-string fish-path ":"))))
(setenv "PATH" fish-path)
(setq exec-path full-path))
@theskumar
theskumar / restricted_usernames.py
Created April 9, 2015 06:48
Restricted usernames
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
'''
List of reserved usernames (pre-defined list of special banned and reserved keywords in names,
such as "root", "www", "admin"). Useful when creating public systems, where users can choose
a login name or a sub-domain name.
__References:__
1. http://www.bannedwordlist.com/
2. http://blog.postbit.com/reserved-username-list.html
@MyITGuy
MyITGuy / file01.ps1
Last active May 6, 2024 23:21
PowerShell: Get-MsiProducts / Get Windows Installer Products
function Get-MsiProducts {
function Get-MsiUpgradeCode {
[CmdletBinding()]
param (
[System.Guid]$ProductCode
,
[System.Guid]$UpgradeCode
)
function ConvertFrom-CompressedGuid {