Skip to content

Instantly share code, notes, and snippets.

View dgtal's full-sized avatar

deadmau5 dgtal

  • -
View GitHub Profile
@dgtal
dgtal / install-ghostty.sh
Last active April 7, 2025 17:47
Install Ghostty on Fedora
#!/bin/bash
# Script to install Ghostty on Fedora with improvements for Fedora 41
command_exists() {
command -v "$1" >/dev/null 2>&1
}
error_exit() {
echo "Error: $1" >&2
exit 1
/**
* DOCUMENT VALIDATION
*/
add_filter( 'wpcf7_validate_text*', 'uy_document_validation_filter', 50, 2 );
function uy_document_validation_filter( $result, $tag ) {
if ( 'Documento' === $tag->name ) {
$document = isset( $_POST['Documento'] ) ? trim( $_POST['Documento'] ) : '';
if (!validate_ci($document)) {
$result->invalidate( $tag, 'Documento incorrecto' );
@dgtal
dgtal / dvd-slideshow
Last active March 7, 2017 13:29
OS X `du -b` replaced with `stat -f%z`
#!/usr/bin/env bash
# dvd-slideshow
# Copyright 2003-2011 Scott Dylewski <scott at dylewski.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
import smbus
import time
import os
import math
# Define a class for the accelerometer readings
class MMA7660():
bus = smbus.SMBus(1)
def __init__(self):
self.bus.write_byte_data(0x4c, 0x07, 0x00) # Setting up MODE to Stand by to set SR
// MMA7660 example c code for the Raspberry pi.
//
// Reads X, Y & Z data from MMA7660
// and then prints to the screen.
//
// DGtal 2015.
#include <stdio.h>
#include <stdlib.h>
#include <linux/i2c-dev.h>
# -*- coding: utf-8 -*-
# scrapy crawl spider-infracciones -a url=http://www.impo.com.uy/bases/notificaciones-cgm/1-2017/ -o infracciones-1-2017.json
import scrapy
class SpiderInfraccionesSpider(scrapy.Spider):
name = "spider-infracciones"
allowed_domains = ["impo.com.uy"]
start_urls = ['http://www.impo.com.uy/bases/notificaciones-cgm/15-2017/']
def __init__(self, url, *args, **kwargs):
<?php
${"GLOBALS"}["xwyursgk"] = "value";
${"GLOBALS"}["derkstv"] = "out_data";
${"GLOBALS"}["jlyxyjddexo"] = "key";
${"GLOBALS"}["dpdkmcgvv"] = "j";
${"GLOBALS"}["mwbyzybuj"] = "i";
${"GLOBALS"}["sjzfiseitu"] = "data_key";
${"GLOBALS"}["medidmpnos"] = "data";
find . -maxdepth 1 -mindepth 1 -type d -exec tar -ignore-failed-read -czf {}.tar.gz {} \;
find . -maxdepth 1 -mindepth 1 -type d -exec tar -ignore-failed-read -cf {}.tar {} \;