Skip to content

Instantly share code, notes, and snippets.

View zorca's full-sized avatar
✴️
Working from a faraway star

Zorca Orcinus zorca

✴️
Working from a faraway star
  • Lithuania
View GitHub Profile
@zorca
zorca / apistore.js
Created September 10, 2020 06:07 — forked from galvez/apistore.js
// APIStoreProps are properties that need to be
// ignored when running APIStore.makeStore()
const APIStoreProps = ['use', 'classes', 'constructor', 'init', 'state']
// getMethods returns methods defined
// in a given class' prototype, except init and constructor
const getMethods = (cls) => {
return Object.getOwnPropertyNames(cls.prototype)
.reduce((obj, prop) => {
@tomasevich
tomasevich / remove-all-from-docker.md
Last active May 19, 2024 00:52 — forked from beeman/remove-all-from-docker.sh
Удалить/очистить все данные Докера (контейнеры, образы, тома и сети)

Удалить/очистить все данные Докера (контейнеры, образы, тома и сети)

Одной строкой

docker stop $(docker ps -qa) && docker rm $(docker ps -qa) && docker rmi -f $(docker images -qa) && docker volume rm $(docker volume ls -q) && docker network rm $(docker network ls -q)

Описание команд

@mihdan
mihdan / wp-image-placeholder.php
Last active December 12, 2022 23:59
Заменяет битые ссылки на кратинки в WordPress на заглушки. Удобно, например на тестовом сайте, чтобы не переносить фотки с боевого.
<?php
/**
* Plugin Name: Mihdan: Image Placeholder
*/
namespace Mihdan\Image_Placeholder;
$images = array(
// Обычные
'https://placeimg.com/640/480/animals',
// APIStoreProps are properties that need to be
// ignored when running APIStore.makeStore()
const APIStoreProps = ['use', 'classes', 'constructor', 'init', 'state']
// getMethods returns methods defined
// in a given class' prototype, except init and constructor
const getMethods = (cls) => {
return Object.getOwnPropertyNames(cls.prototype)
.reduce((obj, prop) => {
@giansalex
giansalex / docker-php-ext-install.md
Last active October 3, 2023 10:02
docker-php-ext-install Reference
RUN apt update
RUN apt upgrade -y
RUN apt install -y apt-utils
RUN a2enmod rewrite
RUN apt install -y libmcrypt-dev
RUN apt install -y libicu-dev
RUN docker-php-ext-install -j$(nproc) intl
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ 
[client-server]
port = 3306
socket = /run/mysqld/mysqld.sock
[client]
[mysqld]
user = mysql
pid-file = /run/mysqld/mysqld.pid
basedir = /usr
@dancourse
dancourse / gist:92cf77829e5b0b5bba62
Last active November 14, 2019 18:31
Laravel Homestead blackfire setup
# Edit out homestead settings
homestead edit
# Enter your details, https://blackfire.io/account/credentials
# See re-provision your homestead box
vagrant global-status
vagrant provision ???? # << this is the id of the homestead instance you have running, from global-status
# So far this didn't work so carry on...
@jcefoli
jcefoli / allkeys.php
Last active November 21, 2022 11:11
List All Key/Value Pairs in Redis using the Predis Library. Assumes that Redis is running locally on default port 6379 with no password auth
<?
//Include Predis library. See https://github.com/nrk/predis for more info
require "Predis/Autoloader.php";
//Connect to Redis
Predis\Autoloader::register();
try {
$redis = new Predis\Client();
$redis = new Predis\Client(array(
"scheme" => "tcp",
@franz-josef-kaiser
franz-josef-kaiser / simplepie_example.php
Created June 7, 2013 17:31
SimplePie - example method to list what information we can retrieve about a feed as a whole and for single items when looping through
<?php
defined( 'ABSPATH' ) OR exit;
/**
* Plugin Name: (WCM) RSS Importer
*/
add_action( 'plugins_loaded', array( 'WCMRSSImporterBootstrap', 'init' ) );
class WCMRSSImporterBootstrap
{
protected static $instance = null;