Skip to content

Instantly share code, notes, and snippets.

@juliencrn
juliencrn / gitignore.sh
Created May 30, 2019 13:37
Remove .idea files from PHPStorm with git & .gitignore
# Remove the file from the repository
git rm --cached .idea/
# now update your gitignore file to ignore this folder
echo '.idea' >> .gitignore
# add the .gitignore file
git add .gitignore
git commit -m "Removed .idea files"
@luigiMinardi
luigiMinardi / tex-colors.md
Last active April 19, 2024 19:20
Github markdown colors (Using Tex and the github MathJax support)

Small warning for everyone that are thinking if using Tex colors is a good idea or not

  • 2023-05-02 - Since a few days ago \colorbox and \fcolorbox are broken and Github did't talk about if it's a temporary thing or if it will not be added back.
    • 2024-01-04 - Since it has not being added back I deduce that it will never be so I removed all mentions to it on the rest of the gist.
  • 2023-09-29 - Tex seems to not work on h1 to h6 anymore (markdown #'s)
    • 2024-01-04 - Now it works again, I'll keep the message for a while to remember that it may change again in the future

As you can se with the above message(s) Tex may not be very stable and may not be an option to you as of the dates expressed above. You can also check other tex problems here.

Github released Tex support and colors* to the markdown and you din't realized

@patrickelectric
patrickelectric / multiple-components.py
Last active April 19, 2024 19:17
Example of using asyncio to run multiple mavlink components
import asyncio
from pymavlink import mavutil
PORT = 6666
CONNECTION_STRING = f'udpout:127.0.0.1:{PORT}'
CONNECTIONS = {}
def get_mavlink_connection(system_id: int, component_id: int):
def create(system_id: int, component_id: int):
return mavutil.mavlink_connection(
@secure-77
secure-77 / Use-Impersonation.ps1
Last active April 19, 2024 19:17 — forked from idavis/Use-Impersonation.ps1
Impersonate a user and execute a script block as that user
#ToExecute
$userName = "user"
$domain = "domain"
$password = '<<<PASS>>>'
$Path = '\\some\path\here'
.\Use-Impersonation.ps1 $userName $domain $password {Get-ChildItem $Path | Foreach { Write-Host $_.Name }}
@mmngreco
mmngreco / py2mermaid.py
Last active April 19, 2024 19:16
[mermaid] classDiagram builder from python code
r"""
This requires to have the library (pkg) pre-installed.
Usage:
$ python ./py2mermaid.py --pkg pandas
$ python ./py2mermaid.py --pkg pandas --base-module pandas.core
$ python ./docs/diagrams/py2mermaid.py --pkg pandas --base-module pandas.core
$ python ./docs/diagrams/py2mermaid.py --pkg pandas --base-module pandas.core --raw | sed "s/\w\.\(\w\)/\U\1/g"
Note: based on https://gist.github.com/Zulko/e0910cac1b27bcc3a1e6585eaee60121
@secure-77
secure-77 / webserver.ps1
Created December 2, 2022 14:31
Powershell Web Shell
<#
.Synopsis
Starts powershell webserver
.Description
Starts webserver as powershell process.
Call of the root page (e.g. http://localhost:8080/) returns a powershell execution web form.
Call of /script uploads a powershell script and executes it (as a function).
Call of /log returns the webserver logs, /starttime the start time of the webserver, /time the current time.
/download downloads and /upload uploads a file. /beep generates a sound and /quit or /exit stops the webserver.
Any other call delivers the static content that fits to the path provided. If the static path is a directory,
@diego3g
diego3g / settings.json
Last active April 19, 2024 19:19
VSCode Settings (Updated)
{
"workbench.startupEditor": "newUntitledFile",
"editor.fontSize": 14,
"editor.lineHeight": 1.8,
"javascript.suggest.autoImports": true,
"javascript.updateImportsOnFileMove.enabled": "always",
"editor.rulers": [80, 120],
"extensions.ignoreRecommendations": true,
"typescript.tsserver.log": "off",
"files.associations": {
@vicasas
vicasas / .eslintignore
Created October 28, 2021 12:10
Next.js Lint with Eslint + Airbnb Style + Husky + Lint-Staged
.next
public
node_modules
yarn.lock
package-lock.json
**/*.test.js
coverage
@nicolasdao
nicolasdao / open_source_licenses.md
Last active April 19, 2024 19:12
What you need to know to choose an open source license.
@secsilm
secsilm / str_count.py
Created March 25, 2017 14:04
使用 Python 统计字符串中英文、空格、数字、标点个数
# coding: utf-8
import string
from collections import namedtuple
def str_count(s):
'''找出字符串中的中英文、空格、数字、标点符号个数'''
count_en = count_dg = count_sp = count_zh = count_pu = 0