Skip to content

Instantly share code, notes, and snippets.

View celian-m's full-sized avatar

celian celian-m

  • MyStudioFactory
  • Paris
View GitHub Profile
@celian-m
celian-m / index.sh
Created July 24, 2024 17:22 — forked from michael-sumner/index.sh
WP-CLI command to loop through all sites in the multisite network and use wp db query to obtain a list of posts, and save them in log.txt file
# replace "Hello, World!" with appropriate string to search for
# replace `post_title` with appropriate column to search for
wp site list --fields=url,blog_id | while IFS= read -r line; do
url=$(echo "$line" | awk -F'\t' '{print $1}')
blog_id=$(echo "$line" | awk -F'\t' '{print $2}')
wp post list --field=url --ignore_sticky_posts=1 --orderby=date --order=DESC --post__in=$(wp db query "SELECT ID FROM wp_${blog_id}_posts WHERE post_title LIKE '%Hello, World!%' AND post_status='publish' AND post_type='post'" --skip-column-names --url=${url} | paste -s -d ',' -) --url=${url}
done >> log.txt
@Azoy
Azoy / install-swift-ubuntu.md
Last active December 9, 2022 03:42
Guide on how to install Swift on Ubuntu

Install Swift on Ubuntu

Requirements

  1. Ubuntu 14.04, 16.04, or 16.10

Step 1 - Dependencies

  1. Open up terminal
  2. Install core deps: sudo apt-get install clang libicu-dev git

Step 1.1 - Ubuntu 14.04 Clang

@celian-m
celian-m / Modern Swift.md
Last active March 22, 2017 07:24
Interesting Swift links
@romaonthego
romaonthego / NSDateFormatter cheat sheet
Last active July 19, 2024 10:39
Date Formats for NSDateFormatter
a: AM/PM
A: 0~86399999 (Millisecond of Day)
c/cc: 1~7 (Day of Week)
ccc: Sun/Mon/Tue/Wed/Thu/Fri/Sat
cccc: Sunday/Monday/Tuesday/Wednesday/Thursday/Friday/Saturday
d: 1~31 (0 padded Day of Month)
D: 1~366 (0 padded Day of Year)
@hramos
hramos / manifest.plist
Created January 11, 2011 14:29
Sample manifest file for Over The Air iOS deployment
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>items</key>
<array>
<dict>
<key>assets</key>
<array>
<dict>