Skip to content

Instantly share code, notes, and snippets.

@andysdesigns
andysdesigns / unique_array.php
Created November 9, 2022 10:49
Removing duplicate values from an multi-dimensional array()
<?php
$data = array_map('unserialize', array_unique(array_map('serialize', $data));
@andysdesigns
andysdesigns / fbMessageDeletr.js
Created August 26, 2021 19:49 — forked from bitmvr/fbMessageDeletr.js
Facebook Message Deleter
javascript: (function () {
const log = function (msg) {
const d = new Date();
const n = d.toISOString();
console.log(`${n} - ${msg}`);
};
const clickMenu = function() {
document
@andysdesigns
andysdesigns / send.py
Created July 7, 2021 19:15 — forked from euphy/send.py
Polargraph queue sender (low resource)
#!/usr/bin/python
"""
Only python package required is pyserial:
pip install pyserial
Use this wee script to send a command queue to a Polargraph machine.
If the filename is "mycommandqueue.txt" and the machine is connected on COM7, then do:
@andysdesigns
andysdesigns / convert_img_to_line_drawing.py
Created June 23, 2021 17:16 — forked from pirosuke/convert_img_to_line_drawing.py
Convert Image Files To Line Drawings With OpenCV
# -*- coding: utf-8 -*-
import os
import cv2
import numpy as np
def create_line_drawing_image(img):
kernel = np.array([
[1, 1, 1, 1, 1],
jQuery.ajax({
url : '<?php echo admin_url('admin-ajax.php'); ?>',
data : { product_cat: category , action : 'newproduct_form'},
method : 'post',
success : function(form){
if (form != 0) {
// remove existing editor instance
tinymce.execCommand('mceRemoveEditor', true, 'post_content');
@andysdesigns
andysdesigns / pi_mount_usb.md
Created June 26, 2018 15:32 — forked from etes/pi_mount_usb.md
How to setup mount / auto-mount USB Hard Drive on Raspberry Pi

How to setup mount / auto-mount USB Hard Drive on Raspberry Pi

Follow the simple steps in the order mentioned below to have your USB drive mounted on your Raspberry Pi every time you boot it.

These steps are required especially if your are setting up a Samba share, or a 24x7 torrent downloader, or alike where your Raspberry Pi must have your external storage already mounted and ready for access by the services / daemons.

Step 0. Plug in your USB HDD / Drive to Raspberry Pi If you are using a NTFS formatted drive, install the following

Pop Up Greeting Cards
> http://retrofox.me/how-to-make-pop-up-greeting-cards/how-to-make-pop-up-greeting-cards-card-making-idea-step-pop-up-card-tutorial-greeting-card-class-templates/
> http://retrofox.me/how-to-make-pop-up-greeting-cards/how-to-make-pop-up-greeting-cards-best-25-pop-up-greeting-cards-ideas-on-pinterest-popup-cards-printable/
> http://www.minieco.co.uk/8-bit-popup-cards/
> http://www.minieco.co.uk/images/feb12/heart-card-template.pdf
> https://www.icreativeideas.com/creative-ideas-diy-pixel-heart-popup-card/
> http://theideaking.blogspot.com/2013/12/diy-pop-out-i-love-u-card.html
> http://www.fabartdiy.com/how-to-diy-paper-puppy-pop-up-greeting-card/
>
@andysdesigns
andysdesigns / gist:12005a233a8bb73413a5dc61c5ab5b52
Created January 31, 2018 14:02
Mysql Import + Export using terminal
# import .sql.gz with progress bar
>> pv [/path/to/database.sql.gz] | gunzip | mysql -u [username] -p [database_name]
---
# import .sql without progress bar
>> mysql -u [username] -p [database_name] < [/path/to/database.sql]
---
@andysdesigns
andysdesigns / touchscreen-fix
Created April 17, 2017 14:08
Fixed TouchSmart Tx2 Touchscreen
In file /usr/share/X11/xorg.conf.d/10-evdev.conf, changing the "evdev" to "libintup" in the touchscreen section do the trick.
So now it looks like this:
----- fix -----
#
# Catch-all evdev loader for udev-based systems
@andysdesigns
andysdesigns / Raspberry Pi command line.txt
Created January 9, 2017 13:01
Useful commands for raspberry pi
# -------------------------------------------------------------------------------------- #
# THINGS TODO AFTER INSTALLING PI #
# -------------------------------------------------------------------------------------- #
#
# update and upgrade firmare and packages
#
sudo apt-get update
sudo apt-get upgrade