Skip to content

Instantly share code, notes, and snippets.

@andyrbell
andyrbell / scanner.sh
Last active October 8, 2025 07:32
Make a pdf look scanned using ImageMagick
# use ImageMagick convert
# the order is important. the density argument applies to input.pdf and resize and rotate to output.pdf
convert -density 90 input.pdf -rotate 0.5 -attenuate 0.2 +noise Multiplicative -colorspace Gray output.pdf
@ThatGuySam
ThatGuySam / time-since.php
Last active March 5, 2025 14:53
Time since Shortcode for Wordpress
<?php
// ex:
// With [time since="1997"] years experience
// outputs: With 20 years of experience
class SCCTimeShortcode {
static $add_script;
static function init() {
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 5.
denumire,localitate,adresa,telefon,localitati_deservite
Direcția Generală Regională a Finanțelor Publice PLOIEȘTI,Ploiești,"Str. Aurel Vlaicu nr. 22, C.P. 00023, Jud. Prahova",0244.407.7 0,Ploiești
Administrația pentru Contribuabili Mijlocii - D.G.R.F.P. Ploiești,Ploiești,"Str. Gh. Grigore Cantacuzino nr. 348, C.P. 0030 ,Jud. Prahova",0244.700.930,Ploiești
Administrația Județeană a Finanțelor Publice ARGEȘ,Argeș,"B-dul Republicii nr. 118, Pitești, C.P.110050","0248.211.511, 0248.211.838","Albota, Bascov, Băbana, Bradu, Budeasa, Ciomăgești, Cocu, Cotmeana, Cuca, Drăganu, Mărăcineni, Merișani, Morărești, Moșoaia, Oarja, Pitești, Poiana Lacului, Săpata, Suseni, Ștefănești, Uda, Vedea"
Serviciul fiscal municipal Câmpulung,Câmpulung,"Str. Negru Vodă nr.117 și Str.Negru Vodă nr.84, C.P. 115100","0248/510830, 0248/510159","Câmpulung, Albeștii de Muscel, Aninoasa, Boteni, Berevoiești, Bughea de Jos, Bughea de Sus, Cetățeni, Dâmbovicioara, Dragoslavele, Godeni, Lerești, Mihăești, Mioarele, Poienarii de Muscel, Stoeneș
/* Center of Gravity Finder
This script will find the center of gravity (centroid) of all closed paths in the selection set. It was built for a specific purpose so does not have much error
handling. For example, if you get errors it may be the result of the selection set containing compound shapes or a self-intersecting polygon.
References for the math:
http://paulbourke.net/geometry/polygonmesh/ (Calculating the area and centroid of a polygon)
https://en.wikipedia.org/wiki/Centroid#Centroid_of_polygon
Save this file with a jsx extension and place in your Illustrator/Presets/en_US/Scripts folder. You can then access it from the File > Scripts menu
@arthurattwell
arthurattwell / dialog.html
Last active August 1, 2022 09:54
Google Sheets script to allow multi-select in cells with data-validation (adapted from https://www.youtube.com/watch?v=dm4z9l26O0I)
<div style="font-family: sans-serif;">
<? var data = valid(); ?>
<form id="form" name="form">
<? if(Object.prototype.toString.call(data) === '[object Array]') { ?>
<? for (var i = 0; i < data.length; i++) { ?>
<? for (var j = 0; j < data[i].length; j++) { ?>
<input type="checkbox" id="ch<?= '' + i + j ?>" name="ch<?= '' + i + j ?>" value="<?= data[i][j] ?>"><?= data[i][j] ?><br>
<? } ?>
<? } ?>
<? } else { ?>
@yazinsai
yazinsai / ImportJSON.gs
Created April 26, 2016 13:38
Get data from any API straight into your Google Sheets, effortlessly!
/*====================================================================================================================================*
ImportJSON by Trevor Lohrbeer (@FastFedora)
====================================================================================================================================
Version: 1.2.1
Project Page: http://blog.fastfedora.com/projects/import-json
Copyright: (c) 2012-2013 by Trevor Lohrbeer
License: GNU General Public License, version 3 (GPL-3.0)
http://www.opensource.org/licenses/gpl-3.0.html
------------------------------------------------------------------------------------------------------------------------------------
A library for importing JSON feeds into Google spreadsheets. Functions include:
@eyecatchup
eyecatchup / git-commit-log-stats.md
Last active September 5, 2025 16:04
Some commands to get git commit log statistics for a repository on the command line.

git commit stats

Commands to get commit statistics for a Git repository from the command line -
using git log, git shortlog and friends.




@manigandham
manigandham / rich-text-html-editors.md
Last active June 2, 2025 03:59
Rich text / HTML editors and frameworks

Strictly Frameworks

Abstracted Editors

These use separate document structures instead of HTML, some are more modular libraries than full editors

@ericandrewlewis
ericandrewlewis / gist:95239573dc97c0e86714
Last active August 2, 2025 18:35
Setting up a WordPress site on AWS

Setting up a WordPress site on AWS

This tutorial walks through setting up AWS infrastructure for WordPress, starting at creating an AWS account. We'll manually provision a single EC2 instance (i.e an AWS virtual machine) to run WordPress using Nginx, PHP-FPM, and MySQL.

This tutorial assumes you're relatively comfortable on the command line and editing system configuration files. It is intended for folks who want a high-level of control and understanding of their infrastructure. It will take about half an hour if you don't Google away at some point.

If you experience any difficulties or have any feedback, leave a comment. 🐬

Coming soon: I'll write another tutorial on a high availability setup for WordPress on AWS, including load-balancing multiple application servers in an auto-scaling group and utilizing RDS.

@bitbybit
bitbybit / temp-email.txt
Last active August 17, 2025 06:26
List of temporary email services
0815.ru
0815.su
10minutemail.com
20mail.it
20minutemail.com
a45.in
anonbox.net
anonymbox.com
antispam.de
armyspy.com