Skip to content

Instantly share code, notes, and snippets.

@mrpatg
mrpatg / factorio.ino
Created December 8, 2020 01:52
Factorio Lab Lamp Arduino/NodeMCU 3 LED Script
#define LED0 D0 // Led in NodeMCU at pin GPIO16 (D0).
#define LED1 D6
#define LED2 D7
#define LED3 D8
void setup() {
pinMode(LED0, OUTPUT); // set the digital pin as output.
pinMode(LED1, OUTPUT); // set the digital pin as output.
pinMode(LED2, OUTPUT); // set the digital pin as output.
pinMode(LED3, OUTPUT); // set the digital pin as output.
}
Afar
Abkhazian
Achinese
Acoli
Adangme
Adyghe Adygei
Afro-Asiatic languages
Afrihili
Afrikaans
Ainu
@mrpatg
mrpatg / permalink_fix.php
Last active July 16, 2020 14:29
rewrite hell

Keybase proof

I hereby claim:

  • I am mrpatg on github.
  • I am mrpatg (https://keybase.io/mrpatg) on keybase.
  • I have a public key whose fingerprint is 518F E33A 6AEF CEA8 C4ED 9D2D 4E18 5680 CDDB 2DD4

To claim this, I am signing this object:

@mrpatg
mrpatg / discord.js
Created October 22, 2019 11:21
Discord - Hide Blocked Message Bar
/*
Open Discord desktop app and press CTRL+SHIFT+I.
Paste this whole thing into the console and press enter.
This will need to be repeated each time Discord is started/restarted.
*/
(function hideBlocked() {
// This script already existed, but the class names in Discord have changed. I modified it to work again.
document.querySelectorAll('[class^=messageGroupBlocked]').forEach(div => div.setAttribute("style", "display: none;"));
@mrpatg
mrpatg / palendrome.php
Created October 7, 2019 22:05
palendrome
<?php
function isPalendrome($input){
trim( $input );
$reverse = strrev( $input );
if($input == $reverse){
return TRUE;
} else {
return FALSE;
@mrpatg
mrpatg / git-deployment.md
Last active April 6, 2019 17:01 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, let's say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@mrpatg
mrpatg / .htaccess
Created April 5, 2019 00:35
.htaccess force https
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301]
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="7zip.install" version="18.5.0.20180730" />
<package id="chocolatey" version="0.10.11" />
<package id="chocolatey-core.extension" version="1.3.3" />
<package id="chocolatey-windowsupdate.extension" version="1.0.2" />
<package id="chocolateygui" version="0.16.0" />
<package id="classic-shell" version="4.3.1.20180405" />
<package id="filezilla" version="3.36.0" />
<package id="golang" version="1.11.0" />
@mrpatg
mrpatg / gist:8d3adbdc1d2be459175769f9c34e463f
Last active January 22, 2018 17:33
wp show post content
<?php
/**
* The Header for our theme
*
* Displays all of the <head> section and everything up till <div id="main">
*
* @package WordPress
* @subpackage Twenty_Fourteen
* @since Twenty Fourteen 1.0
*/