Skip to content

Instantly share code, notes, and snippets.

//jvascript
//id, culture, label
var c1 = new Calendar('dateStart', 'es-MX', 'Start Date');
//HTML - min & max date in mm/dd/yy format
<input type="text" id="dateStart" name="dateStart"
data-val="true"
data-val-required="required"
data-val-daterange="invalid"
@mcastelino
mcastelino / iptables-cheatsheet.md
Last active April 19, 2024 02:31
iptables-cheatsheet

The netfilter hooks in the kernel and where they hook in the packet flow

The figure below calls out

  • The netfilter hooks
  • The order of table traversal
@bjacob
bjacob / README.md
Last active April 19, 2024 02:31
IREE / MLIR / Linalg tutorial

IREE/MLIR/Linalg tutorial

Introduction

This tutorial is simultaneously about IREE, MLIR, and specifically the MLIR Linalg dialect.

What is MLIR?

MLIR is a programming language, but MLIR in itself is almost just an empty shell. What it really provides is a framework allowing to define MLIR dialects which are where the features come from.

@idleberg
idleberg / vscode-macos-context-menu.md
Last active April 19, 2024 02:28
“Open in Visual Studio Code” in macOS context-menu

Open in Visual Studio Code

  • Open Automator
  • Create a new document
  • Select Quick Action
  • Set “Service receives selected” to files or folders in any application
  • Add a Run Shell Script action
    • your default shell should already be selected, otherwise use /bin/zsh for macOS 10.15 (”Catalina”) or later
    • older versions of macOS use /bin/bash
  • if you're using something else, you probably know what to do 😉
@scriptdev
scriptdev / .php
Last active April 19, 2024 02:27
OCULTAR COLUNA DO DATAGRID DETAILFORM
<?php
# SEM O CLASS
TScript::create("$('table th:contains(\"TITULO DA COLUNA\")').hide();");
# COM O CLASS
TScript::create("$('table th.tdatagrid_col:contains(\"TITULO DA COLUNA\")').hide();");
# "tdatagrid_col" É O NOME DO class
# "TITULO DA COLUNA" É O NOME DO TÍTULO DA COLUNA
@scriptdev
scriptdev / .php
Created November 4, 2023 13:43
VERIFICAR SE OS DADOS DO SMTP DO E-MAIL FOI PREENCHIDOS EM PREFERÊNCIAS
<?php
TTransaction::open(self::$database);
$preferences = SystemPreference::getAllPreferences();
$mail_from = $preferences['mail_from'];
$host = $preferences['smtp_host'];
if (!empty($mail_from) and !empty($host))
@irisTa56
irisTa56 / ipyvolume_gc.py
Last active April 19, 2024 02:26
Visualize a Gaussian Cube file by IPyVolume.
import ipyvolume.pylab as p3
import numpy as np
element_list = [
"H", "He", "Li", "Be", "B", "C", "N", "O", "F", "Ne",
"Na", "Mg", "Al", "Si", "P", "S", "Cl", "Ar", "K", "Ca"
]
class IPyVolume_GC:
"""
@nepsilon
nepsilon / git-change-commit-messages.md
Last active April 19, 2024 02:23
How to change your commit messages in Git? — First published in fullweb.io issue #55

How to change your commit messages in Git?

At some point you’ll find yourself in a situation where you need edit a commit message. That commit might already be pushed or not, be the most recent or burried below 10 other commits, but fear not, git has your back 🙂.

Not pushed + most recent commit:

git commit --amend

This will open your $EDITOR and let you change the message. Continue with your usual git push origin master.

@actuino
actuino / bt_speaker-raspberry_pi-zero_w.md
Last active April 19, 2024 02:22
Setting up a Bluetooth Speaker from the command line on a raspberry Pi Zero W

The setup of a bluetooth speaker on a Pi Zero W is pretty touchy.

Please get in touch via Twitter @actuino or http://www.actuino.fr/ if you've got comments or improvements to this quick draft.

First checks

  • Use a solid power source
  • check the speaker works on another hardware (android phone f.i.)
  • make sure you've updated your Raspbian, install and run rpi-update just in case.
@adrianhorning08
adrianhorning08 / index.js
Last active April 19, 2024 02:22
Scraping Linkedin Search Results
// copy into a file called linkedinScrape.js (or whatever you want to call it) then call node linkedinScrape.js
const cookies = "" // your cookies
const page = 1
const searchTerm = "marketing agency"
const results = await searchLinkedIn(searchTerm, page)
console.log(results)
export async function searchLinkedIn(query, page = 1) {
try {