Skip to content

Instantly share code, notes, and snippets.

Coding Stuff

Ionuț Staicu iamntz

Coding Stuff
View GitHub Profile
iamntz /
Last active May 17, 2022
WP CLI wrapper to run commands on all sites in a network

After you install wp-cli:

If you're on Linux:

  1. Install wpmu wrapper: curl -o /usr/local/bin/wpmu
  2. make it executable: chmod +x /usr/local/bin/wpms
  3. Run commands as you'd normally do, using wpms instead, e.g. wpms plugin list

If you're on Windows:

View gist:10740afa881010ac4d97e374a8ee4718
Usage: curl [options...] <url>
--abstract-unix-socket <path> Connect via abstract Unix domain socket
--alt-svc <file name> Enable alt-svc with this cache file
--anyauth Pick any authentication method
-a, --append Append to target file when uploading
--aws-sigv4 <provider1[:provider2[:region[:service]]]> Use AWS V4 signature authentication
--basic Use HTTP Basic Authentication
--cacert <file> CA certificate to verify peer against
--capath <dir> CA directory to verify peer against
-E, --cert <certificate[:password]> Client certificate file and password
View gist:1c9d3b47fbba614e0690185b90312f7e
enterEditMode() {
if (!this.editable || this.isLoading || this.isEditing) {
this.isLoading = true;
this.loadValues( => {
this.isLoading = false;
this.isEditing = true;
iamntz /
Last active Mar 24, 2020
Șterge spamul de la 2performant
  1. Deschizi chrome dev tools
  2. Faci orice operațiune ajax în UI 2performant
  3. te duci în tab-ul network
  4. click 2 -> copy -> fetch (atenție, să fie headerele ce includ și adresa de mail)
  5. copiezi tot ce este în header în INSERT_HEADERS_HERE
  6. Posibil să fie nevoie să ajustezi page=1&perpage=100
  7. Paste la tot în consolă.
iamntz / HandlePutFormData.php
Last active Jan 20, 2021 — forked from Stunext/HandlePutFormData.php
Laravel: Middleware to support multipart/form-data in PUT, PATH and DELETE requests. Deals with one level of form arrays.
View HandlePutFormData.php
namespace App\Http\Middleware;
use Closure;
use Symfony\Component\HttpFoundation\ParameterBag;
* @author
* PHP, and by extension, Laravel does not support multipart/form-data requests when using any request method other than POST.
View acf-post_object-emoji.php
add_filter("acf/fields/post_object/result", function ($title, $post, $field, $post_id) {
if (has_post_thumbnail($post->ID)) {
$title .= ' 🖼'; // picture emoji
return $title;
}, 10, 4);
View acf-wpml-media.php
add_action('wpml_updated_translation_status', function ($data) {
$postid = $data['translation_id'];
$groups = acf_get_field_groups();
foreach ($groups as $group) {
$fields = acf_get_fields($group);
foreach ($fields as $field) {
if ($field['type'] == 'gallery') {
$fieldValues = get_field($field['name'], $postid, false);
iamntz / repeatable.php
Last active Oct 3, 2018 — forked from JAW-Dev/repeatable.php
Repeatable Option Fields
View repeatable.php
if( !class_exists( 'OU_Settings' ) ) {
class OU_Settings {
* Option
View make-vvv.js
var fs = require('fs');
var path = require('path');
var readline = require('readline');
var args = process.argv.slice(2);
var clientName, projectName;
clientName = projectName = args[0];
if( args[1] ){
projectName = args[1];
iamntz / 0_reuse_code.js
Created May 31, 2014
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console