Skip to content

Instantly share code, notes, and snippets.

View baditaflorin's full-sized avatar

Florin Badita-Nistor baditaflorin

View GitHub Profile
You are Webby, a website creation assistant.
Carefully adhere to the following steps for our conversation. Do not skip any steps!:
1. Introduce yourself
2. Ask my name and where I'm from. Offer me the option to continue in a different language, but default to English. In the next message say something personal and kind about where I'm from and include an emoji that references where I'm from.
3. Give me an extremely brief overview of how the website building process will go. Use numbered steps and emojis.
4. Ask what type of website I want to make (offer examples)
5. Ask what I'd like to title the website.
6. Ask a series of questions to clarify information and constraints for the website
@mietzen
mietzen / ext4fuse.rb
Last active June 16, 2022 09:27
ext4fuse for M1 Macs running macOS 12.x, code from @marcuspridham + corrections from @FelixLisczyk, install instructions below
class MacFuseRequirement < Requirement
fatal true
satisfy(build_env: false) { self.class.binary_mac_fuse_installed? }
def self.binary_mac_fuse_installed?
File.exist?("/usr/local/include/fuse/fuse.h") &&
!File.symlink?("/usr/local/include/fuse")
end
@Danny-Engelman
Danny-Engelman / findeElements with TreeWalker API
Created March 23, 2021 11:26
findElements with TreeWalker API
// The native TreeWalker API has been around for ages, IE9 was the last Browser to implement it ... in 2011
function log() {
console.log(`%c TreeWalker `, `background:purple;color:yellow`, ...arguments);
}
// find element takes a function definition, the output must be Truthy or Falsy
function findElements(
acceptFunc = (x) => customElements.get(x.localName) || false
) {
log("start");
console.time("TreeWalker");
@codingjoe
codingjoe / geodjango_macOS_arm64.md
Created March 11, 2021 10:29
HowTo run GeoDjango and PostGIS on M1 macOS arm64 MacBook
  1. Install PostgreSQL with PostGIS via Postges.app
  2. Install brew as recommended.
  3. Install dependencies:
    brew install geos gdal
    
  4. Add the following to your settings:
    # settings.py
    

GDAL_LIBRARY_PATH = os.getenv('GDAL_LIBRARY_PATH')

# Get all entries like Melissa, Melli.
# Not depending on how many characters are wildcarded.
SELECT * FROM example_table WHERE example_column LIKE 'Mel%';
# Get all entries like Meli, Melo.
# Depending on how many characters are wildcarded.
SELECT * FROM example_table WHERE example_column LIKE 'Mel_';
# Or for multiple characters, here 2
SELECT * FROM example_table WHERE example_column LIKE 'Mel__';
@RichardBronosky
RichardBronosky / similarities.sh
Created February 8, 2019 07:47
Identify how similar a file is to each file in a group of others.
#!/bin/bash
fileA="$1"
shift
for fileB in "$@"; do
(
# diff once grep twice with the help of tee and stderr
diff $fileA $fileB | \
tee >(grep -cE '^< ' >&2) | \
grep -cE '^> ' >&2
@rsperl
rsperl / nmap_examples.md
Last active February 16, 2024 02:13
nmap examples #snippet
@terencezl
terencezl / convert_pdf.py
Created April 20, 2017 04:39
use pdfminer to extract pdf
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
from pdfminer.converter import TextConverter, XMLConverter, HTMLConverter
from pdfminer.layout import LAParams
from pdfminer.pdfpage import PDFPage
from io import BytesIO
def convert_pdf(path, format='text', codec='utf-8', password=''):
rsrcmgr = PDFResourceManager()
retstr = BytesIO()
laparams = LAParams()
@light44
light44 / lda.py
Created December 21, 2016 02:10
Latent Dirichlet Allocation using gensim
import nltk
import pandas as pd
import re
import pprint
import operator
import csv
import logging
from stop_words import get_stop_words
from collections import defaultdict
from gensim import corpora
@baditaflorin
baditaflorin / README.md
Created November 28, 2016 15:59 — forked from addyosmani/README.md
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version