Skip to content

Instantly share code, notes, and snippets.

@agentcooper
agentcooper / 0.README.md
Last active May 15, 2025 05:56
Telegram chat backup/export

How to use

  1. Login to https://web.telegram.org
  2. Copy-paste contents of telegram-scripts.js into JS console
  3. Run showContacts() to get the list of contacts with ids
  4. Run saveChat(userId) where userId is the id from step 3

Process can take a while, check console for progress. Occasionall FLOOD_WAIT errors are expected. Once done, browser will download the JSON file.

Motivation

@mariovalney
mariovalney / woo-enable-reviews-bulk-edit.php
Created August 7, 2017 19:55
WooCommerce Enable Reviews - Bulk Edit
<?php
/**
*
* Plugin Name: WooCommerce Enable Reviews - Bulk Edit
* Description: Allow enable reviews by bulk edit into WooCommerce
* Version: 1.0.0
* Author: Mário Valney
* Author URI: http://mariovalney.com
* Text Domain: woo-enable-reviews-bulk-edit
*
@levantoan
levantoan / [Support-WPML]set_product_category_base_same_shop_base.php
Last active October 14, 2024 15:00
How to set product category base the same as shop base in WooCommerce
<?php
/*
Support WPML - 25/02/2019
/*
function devvn_product_category_base_same_shop_base( $flash = false ){
global $sitepress;
$languages = icl_get_languages('skip_missing=0&orderby=code');
if($languages && !empty($languages)){
$original_lang = ICL_LANGUAGE_CODE;
foreach($languages as $key=>$lang) {
@skipshean
skipshean / remove-wc-sidebar-divi
Created December 21, 2016 02:38
Remove the sidebar in Divi theme WooCommerce pages
/*=====[ Divi Theme hide sidebar on WooCommerce product and shop pages ]=====*/
.woocommerce-page #left-area {
padding-right: 0 !important;
width: 100%;
}
.woocommerce-page #sidebar {
display: none;
}
.woocommerce-page #main-content .container::before {
@smartdeal
smartdeal / cf7-sendpulse.php
Last active March 1, 2022 07:11
пример интеграции #Wordpress #Sendpulse #WP_CF7
<?php
function add_email_to_sendpulse($contact_form) {
$wpcf7 = WPCF7_ContactForm::get_current();
$submission = WPCF7_Submission::get_instance();
$data = $submission->get_posted_data();
$cur_email = $data['Email'];
if ($cur_email != '') {
define( 'API_USER_ID', '' );
@jekey123
jekey123 / UM-Infinte-Scroll.html
Last active February 7, 2018 20:02
Ultimate Member Infinite Scroll Member Directory
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery-infinitescroll/2.1.0/jquery.infinitescroll.min.js" defer="defer"></script>
<script type="text/javascript">
(function() {
function waitDefer(method) {
if (window.jQuery && window.jQuery.fn.infinitescroll)
method();
else
setTimeout(function() { waitDefer(method) }, 50);
}
@champsupertramp
champsupertramp / Ultimate Member - Hides current user from search query in member directory
Created September 18, 2016 14:43
Ultimate Member - Hides current user from search query in member directory
<?php
/**
* Hides current user from search query in member directory
*/
add_filter('um_prepare_user_query_args', 'um_remove_current_user_from_query', 10, 2);
function um_remove_current_user_from_query( $query_args, $args ){
$query_args['exclude'] = array( get_current_user_id() );
return $query_args;
@champsupertramp
champsupertramp / Ultimate Member - UM Custom user query in Member Directory
Last active April 16, 2021 06:44
Ultimate Member - UM Custom user query in Member Directory
<?php
/**
* Show users with a Job Title "'WP Plugin developer " only
**/
add_filter('um_prepare_user_query_args', 'um_my_custom_query_args', 99, 2);
function um_my_custom_query_args( $query_args, $args ) {
if( $args["form_id"] == "1" ) { // you can validate the current member directory form ID
$query_args['meta_query'][] = array(
@champsupertramp
champsupertramp / Ultimate Member - User meta shortcodes
Last active December 8, 2024 04:32
Ultimate Member - User meta shortcodes
/**
* Returns a user meta value
* Usage [um_user user_id="" meta_key="" ] // leave user_id empty if you want to retrive the current user's meta value.
* meta_key is the field name that you've set in the UM form builder
* You can modify the return meta_value with filter hook 'um_user_shortcode_filter__{$meta_key}'
*/
function um_user_shortcode( $atts ) {
$atts = extract( shortcode_atts( array(
'user_id' => get_current_user_id(),
'meta_key' => '',
@anstak
anstak / gist:045d2f79934b3eea171fd2198feff4a5
Last active May 29, 2023 05:01 — forked from seanmcn/gist:62a021a765ad4f8e593b
The Perfect Web Server - Nginx, Ajenti, Ubuntu
#Insall Ajenti
apt-get update
wget http://repo.ajenti.org/debian/key -O- | apt-key add -
echo "deb http://repo.ajenti.org/ng/debian main main ubuntu" >> /etc/apt/sources.list
apt-get update
apt-get install ajenti
service ajenti restart
# Uninstall Apache2