Skip to content

Instantly share code, notes, and snippets.

View pachacamac's full-sized avatar
🌶️
Mmmmhmmmm

Marc pachacamac

🌶️
Mmmmhmmmm
  • Hacker/Founder
  • Germany, Berlin
View GitHub Profile
@bilobom
bilobom / gist:8076d2d4ff6bda55fc2a13aa5e803eea
Last active February 23, 2024 17:10
codemirror6 react custom autocomplete

In this gist we add Custom HTML and JSON autocomplete without overriding the original autocomplete. Each language support in code mirror exports nameLanguage (eg: htmlLanguage) to allow you to add custom autocomplete.

import React, { useMemo } from 'react'
import CodeMirror from '@uiw/react-codemirror'
import { json, jsonLanguage } from '@codemirror/lang-json'
import { html, htmlLanguage } from '@codemirror/lang-html'
import { syntaxTree } from '@codemirror/language'
@u1i
u1i / doit.txt
Created June 21, 2021 11:28
pdftk MacOs M1
https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk_server-2.02-mac_osx-10.11-setup.pkg
@marlosirapuan
marlosirapuan / gist:778d6beda5f8ab95695748011c864b19
Last active April 13, 2024 09:28
Download .m3u8 files on MacOS

Install ffmpeg

brew install ffmpeg

Download file through url, like this:

ffmpeg -protocol_whitelist file,http,https,tcp,tls,crypto -i "http://url-file.domain.m3u8" -c copy video.mp4
@dmmeteo
dmmeteo / 1.srp.py
Last active April 23, 2024 15:09
SOLID Principles explained in Python with examples.
"""
Single Responsibility Principle
“…You had one job” — Loki to Skurge in Thor: Ragnarok
A class should have only one job.
If a class has more than one responsibility, it becomes coupled.
A change to one responsibility results to modification of the other responsibility.
"""
class Animal:
def __init__(self, name: str):
@gmolveau
gmolveau / uuid_user.py
Last active April 17, 2024 15:49
sqlalchemy uuid for sqlite
########################
# UUID for SQLite hack #
########################
from sqlalchemy.types import TypeDecorator, CHAR
from sqlalchemy.dialects.postgresql import UUID
import uuid
class GUID(TypeDecorator):
@iscott
iscott / simple_authentication_rails_5_bcrypt_and_has_secure_password.md
Last active March 15, 2024 03:23
Cheat Sheet: Simple Authentication in Rails 5 with has_secure_password

Cheat Sheet: Simple Authentication in Rails 6 with has_secure_password

The goal of this cheatsheet is to make it easy to add hand-rolled authentication to any rails app in a series of layers.

First the simplest/core layers, then optional layers depending on which features/functionality you want.

Specs
AUTHOR Ira Herman
LANGUAGE/STACK Ruby on Rails Version 4, 5, or 6
@yossorion
yossorion / what-i-wish-id-known-about-equity-before-joining-a-unicorn.md
Last active April 7, 2024 22:55
What I Wish I'd Known About Equity Before Joining A Unicorn

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

@clhenrick
clhenrick / README.md
Last active August 16, 2023 09:47
Data URI SVG icons with Leaflet
@serapath
serapath / index.html
Last active September 23, 2015 16:16
App Loader with Update Manager
<body><script>
/* SET `$appurl` as argument to the IIFE
to load any javascript (localstorage size limit 5mb)
The first page visit will load the whole script, follow-up visits
load the cached script right away and if a new version is available,
offer to update the app now or later.
(The caching only works if the server sends `header.etag`)
I welcome suggestions/questions/discussions - just drop me a message :-)
http://twitter.com/serapath
@atcuno
atcuno / gist:3425484ac5cce5298932
Last active March 25, 2024 13:55
HowTo: Privacy & Security Conscious Browsing

The purpose of this document is to make recommendations on how to browse in a privacy and security conscious manner. This information is compiled from a number of sources, which are referenced throughout the document, as well as my own experiences with the described technologies.

I welcome contributions and comments on the information contained. Please see the How to Contribute section for information on contributing your own knowledge.

Table of Contents