Skip to content

Instantly share code, notes, and snippets.

View lots0logs's full-sized avatar
🧑‍💻
Working on Divi Sites

Dustin Falgout lots0logs

🧑‍💻
Working on Divi Sites
View GitHub Profile
@hofmeister
hofmeister / xmlrpc.php
Created February 12, 2012 12:34
PHP simple XML-RPC Client
<?php
/**
* @author Henrik Hofmeister
* @license MIT
* @version 1.0
*
* XmlRPC using SimpleXML and CURL
*
* Usage:
*
@trongthanh
trongthanh / gist:2779392
Last active September 8, 2024 09:15
How to move a folder from one repo to another and keep its commit history
# source: http://st-on-it.blogspot.com/2010/01/how-to-move-folders-between-git.html
# First of all you need to have a clean clone of the source repository so we didn't screw the things up.
git clone git://server.com/my-repo1.git
# After that you need to do some preparations on the source repository, nuking all the entries except the folder you need to move. Use the following command
git filter-branch --subdirectory-filter your_dir -- -- all
# This will nuke all the other entries and their history, creating a clean git repository that contains only data and history from the directory you need. If you need to move several folders, you have to collect them in a single directory using the git mv command.
@P7h
P7h / IntelliJ_IDEA__Perf_Tuning.txt
Last active October 21, 2024 01:10
Performance tuning parameters for IntelliJ IDEA. Add these params in idea64.exe.vmoptions or idea.exe.vmoptions file in IntelliJ IDEA. If you are using JDK 8.x, please knock off PermSize and MaxPermSize parameters from the tuning configuration.
-server
-Xms2048m
-Xmx2048m
-XX:NewSize=512m
-XX:MaxNewSize=512m
-XX:PermSize=512m
-XX:MaxPermSize=512m
-XX:+UseParNewGC
-XX:ParallelGCThreads=4
-XX:MaxTenuringThreshold=1
@klihelp
klihelp / wc-pagination-functions.php
Last active June 6, 2022 03:37
WooCommerce shortcode pagination on pages
<?php
/**
* Thanks for James Kemp / Iconic turning the idea into a plugin
* https://wordpress.org/plugins/shortcode-pagination-for-woocommerce
*
* This code shows pagination for WooCommerce shortcodes when it's embeded on single pages.
* Include into functions.php.
*/
if ( ! is_admin() ) {
@stefansundin
stefansundin / install-pre-commit.sh
Last active November 15, 2024 10:49
Git pre-commit check to stop accidental commits to master/main/develop branches.
#!/bin/bash
# This gist contains pre-commit hooks to prevent you from commiting bad code or to the wrong branch.
# There are six variants that I have built:
# - pre-commit: stops commits to master/main/develop branches.
# - pre-commit-2: also includes a core.whitespace check.
# - pre-commit-3: the core.whitespace check and an EOF-newline-check.
# - pre-commit-4: only the core.whitespace check.
# - pre-commit-5: elixir formatting check.
# - pre-commit-6: prettier formatting check.
# Set the desired version like this before proceeding:
@dankrause
dankrause / ipc.py
Last active September 10, 2024 19:57
Simple socket IPC in python
# Copyright 2017 Dan Krause
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@mamboer
mamboer / bash-dircolors-monokai
Last active November 17, 2018 10:15
bash console color configurations
# vim: set filetype=bash :
# Install: `ln -s ~/.bash/dircolors ~/.dircolors`
# Configuration file for the color ls utility
# This file goes in the /etc directory, and must be world readable.
# You can copy this file to .dir_colors in your $HOME directory to override
# the system defaults.
# COLOR needs one of these arguments: 'tty' colorizes output to ttys, but not
# pipes. 'all' adds color characters to all output. 'none' shuts colorization
# off.
@bennadel
bennadel / code-1.htm
Created March 25, 2014 10:46
Ask Ben: Overriding Core jQuery Methods
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Overriding jQuery Methods</title>
<script type="text/javascript" src="jquery-1.3.2.js"></script>
<script type="text/javascript">
// Create a closure so that we can define intermediary
// method pointers that don't collide with other items
// in the global name space.
@tassoevan
tassoevan / transparent-window.py
Last active November 3, 2017 03:16
Transparent window for WebView (WebKit) in Python (in progress)
import sys
from gi.repository import Gtk, Gdk, WebKit
class WebKitWindow(Gtk.Window):
scrolls = None
webView = None
def __init__(self, url, transparent=False):
Gtk.Window.__init__(self, Gtk.WindowType.TOPLEVEL, title='')
self.scrolls = Gtk.ScrolledWindow()
@dasevilla
dasevilla / github-issue-to-phab-task.py
Created May 6, 2014 23:01
Copy GitHub issues to Phabricator
import json
import os
import requests
GITHUB_TOKEN = os.environ.get('GITHUB_TOKEN')
if GITHUB_TOKEN is None:
raise Exception('Missing GITHUB_TOKEN from os.environ')