Skip to content

Instantly share code, notes, and snippets.

View kuzminT's full-sized avatar

Timofey Kuzmin kuzminT

View GitHub Profile
@da1nonly
da1nonly / gist:2057532
Created March 17, 2012 10:55
wordpress meta box urls
<?php
add_action('admin_init', 'add_meta_boxes', 1);
function add_meta_boxes() {
add_meta_box( 'repeatable-fields', 'Audio Playlist', 'repeatable_meta_box_display', 'post', 'normal', 'high');
}
function repeatable_meta_box_display() {
global $post;
@Stanback
Stanback / nginx.conf
Last active June 14, 2024 10:21 — forked from michiel/cors-nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
@msurguy
msurguy / List.md
Last active April 30, 2024 15:14
List of open source projects made with Laravel

Other people's projects:

My projects (tutorials are on my blog at http://maxoffsky.com):

@burnash
burnash / gist:d6d35fbabd2566f2b1b9
Last active May 23, 2023 22:47
Find strings with non-latin characters in files
import sys
import os
import codecs
import unicodedata as ud
# from http://stackoverflow.com/questions/3094498/how-can-i-check-if-a-python-unicode-string-contains-non-western-letters
latin_letters = {}
@indraniel
indraniel / tar-gz-reader.go
Created February 23, 2015 19:05
Reading through a tar.gz file in Go / golang
package main
import (
"archive/tar"
"compress/gzip"
"flag"
"fmt"
"io"
"os"
)
@ccurtin
ccurtin / Custom Social Sharing Buttons for Wordpress Shortcode.php
Last active May 8, 2023 19:31
Custom Social Sharing Buttons for Wordpress
<?php
/*
http://stackoverflow.com/questions/12448134/social-share-links-with-custom-icons
http://petragregorova.com/articles/social-share-buttons-with-custom-icons
wp_enqueue_style('fontAwesome', '//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.min.css', array(), '4.3.0', 'all');
use in template files:: <?php echo do_shortcode('[social_sharing]') ; ?>
*/
@Sukonnik-Illia
Sukonnik-Illia / fast_iter.py
Created October 5, 2015 15:18
low memory lxml.etree.iterparse
from lxml import etree
def fast_iter(context, func, *args, **kwargs):
""" call func on each xml element chosen when create context
context = etree.iterparse('path to file', tag='your tag', events)
"""
for event, elem in context:
func(elem, *args, *kwargs)
elem.clear()
@Committing
Committing / .hgignore
Last active May 6, 2023 02:07
.hgignore specifically for Wordpress
# Compiled by Jack (Committing)
# https://gist.github.com/Committing/7bd55ff4615248b7cea0
# GIT version: https://gist.github.com/Committing/24700559b3c05bdd2e3921c12c16f134
#################################
## Target root files/folders
#################################
syntax: regexp
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@mdamien
mdamien / 0readme.md
Last active February 22, 2024 12:11
404 link detector with scrapy

List all the broken links on your website

Requirements:

python3 and scrapy (pip install scrapy)

Usage

  • scrapy runspider -o items.csv -a site="https://yoursite.org" 1spider.py
  • python3 2format_results.py