Skip to content

Instantly share code, notes, and snippets.

View czarpino's full-sized avatar

Czar Pino czarpino

View GitHub Profile
// ==UserScript==
// @name Github Profile StackOverflow Icon
// @namespace http://pjpscriv.com/
// @version 2025-03
// @description Prettify StackOverflow links on Github Profiles, as is done for other social media platforms.
// @author @pjpscriv
// @match https://github.com/*
// @match https://gist.github.com/*
// @exclude https://github.com/*/.*
// @icon https://upload.wikimedia.org/wikipedia/commons/thumb/c/c2/GitHub_Invertocat_Logo.svg/240px-GitHub_Invertocat_Logo.svg.png
@kleo
kleo / backspace.md
Last active July 7, 2024 16:31
backspace

Project moved due to excessive amount of unicorns. Repo https://git.io/adminpldt

Our community of amazing people. Managed by a cat. Backspace https://discord.gg/C43625u

Gist here will not be updated anymore Discussion here on Gist is still allowed but I strongly recommend going over to the repository or Discord chat


@fntlnz
fntlnz / self-signed-certificate-with-custom-ca.md
Last active June 10, 2025 19:31
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@simonw
simonw / how-to.md
Last active April 16, 2025 15:21
How to create a tarball of a git repository using "git archive"
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@eduwass
eduwass / duplicate-post.php
Last active September 17, 2024 15:16
Programmatically duplicating a WordPress post
<?php
/**
* Duplicates a post & its meta and returns the new duplicated Post ID.
*
* @param int $post_id The Post ID you want to clone.
* @return int The duplicated Post ID.
*/
function duplicate_post(int $post_id): int
{
@chadrien
chadrien / README.md
Last active April 22, 2025 15:52
Debug PHP in Docker with PHPStorm and Xdebug

Debug your PHP in Docker with Intellij/PHPStorm and Xdebug

  1. For your local dev, create a Dockerfile that is based on your production image and simply install xdebug into it. Exemple:
FROM php:5

RUN yes | pecl install xdebug \
&amp;&amp; echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" &gt; /usr/local/etc/php/conf.d/xdebug.ini \
@markusklems
markusklems / lambda-dynamo
Last active November 24, 2024 01:48
Short aws lambda sample program that puts an item into dynamodb
// create an IAM Lambda role with access to dynamodb
// Launch Lambda in the same region as your dynamodb region
// (here: us-east-1)
// dynamodb table with hash key = user and range key = datetime
console.log('Loading event');
var AWS = require('aws-sdk');
var dynamodb = new AWS.DynamoDB({apiVersion: '2012-08-10'});
exports.handler = function(event, context) {
@mrkrstphr
mrkrstphr / README.md
Last active February 5, 2019 13:17
Deploying Sculpin Sites to GitHub Pages

Deploying Sculpin Sites to GitHub Pages

I wanted to be able to use Sculpin to generate GitHub pages. Here's what I did...

  1. Created a super awesome Sculpin site from the Sculpin Blog Skeleton

  2. Make sure everything is under version control in my master branch (except things that shouldn't be. see the .gitignore)

  3. Updated publish.sh:

#!/bin/bash

A simple JS event dispatcher that relies on a common key for the handler and data to dispatch actions.

var eventDispatcher = (function (eventDispatcher) {
    var eventHandlers = {};
    
    var eventDispatcher.register = function (key, handler) {
        eventHandlers[key] = handler;
    };

eventDispatcher.dispatch = function (data) {