Skip to content

Instantly share code, notes, and snippets.

@kconner
kconner / macOS Internals.md
Last active April 22, 2024 21:28
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@petertwise
petertwise / acf-install-license
Last active January 19, 2024 14:48 — forked from polevaultweb/acf_pro_license_constant.php
Define the Advanced Custom Fields Pro license key with a constant
#!/bin/bash
# Setup ACF Pro to use a license key in wp-config
#
# 1. Place your license key in a file called .acf-license-key somewhere your ssh user has access to it.
# Default is in your home directory: ~/.acf-license-key
# Change the setting below if you need to put it somewhere else
# 2. install this file in /usr/local/bin or someplace in your PATH
# 3. make sure you have WP CLI installed
# 4. run acf-install-license from the root of your wordpress install
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name="viewport" />
<link rel="icon" href="data:,">
<title>String art</title>
<script type="text/javascript" src="jquery.min.js"></script>
<style>
html, body {
import collections
import math
import os
import cv2
import numpy as np
import time
MAX_LINES = 4000
N_PINS = 36*8
MIN_LOOP = 20 # To avoid getting stuck in a loop
@EngKhaledB
EngKhaledB / .lando.yml
Last active May 21, 2023 20:52
Setup MailHog with Lando, Pantheon & WordPress
name: appname
recipe: pantheon
config:
framework: wordpress
site: appname
id: [side-id]
proxy:
mailhog:
- mail.appname.lndo.site
services:
@yuseferi
yuseferi / fix-files-directories-permission-php.php
Last active September 4, 2018 06:49
Fix Files Directories Permissions by PHP code
<?php
fix_file_directory_permission(dirname(__FILE__));
function fix_file_directory_permission($dir, $nomask = array('.', '..')) {
if (is_dir($dir)) {
// Try to fix directories permission
if (@chmod($dir, 0755)) {
echo "<p>Permission Fixed for : " . $dir . "</p>";
}
}
@andyrbell
andyrbell / scanner.sh
Last active April 5, 2024 09:01
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
@kyletaylored
kyletaylored / drupalvm-setup.sh
Last active October 18, 2018 14:32
A shell script to help set up a standard DrupalVM project
#!/bin/bash
# Get project directory and git url
echo "Project code (used for project directory name):"
read project_code
echo "Project repo git url (can be blank):"
read project_git_url
# Clone DrupalVM
git clone git@github.com:geerlingguy/drupal-vm.git $project_code
@MichaelLawton
MichaelLawton / deleteAmazonSavedItems.js
Last active April 24, 2024 19:06
Removes all Amazon saved for later items on the cart page. It will only remove visible items. You might want to scroll first to make more items visible. To use paste code in developer console (Ctrl+Shift+J or Cmd+Opt+J in Chrome) then press enter.
function deleteSavedItems() {
var query = document.querySelectorAll("#sc-saved-cart input[value=Delete]")
if (query.length) {
query[0].click();
}
if (query.length > 1) {
setTimeout(deleteSavedItems,100);
}
else {
console.log('Finished');
@shrop
shrop / policy.drush.inc
Created April 8, 2016 15:51
Sample Drush policy file
<?php
/**
* @file
* Drush policies to restrict what is allowed for certain drush commands.
*/
/**
* Prevent production databases from being overwritten using drush sql-sync.
*/