Skip to content

Instantly share code, notes, and snippets.

View mcarpenterjr's full-sized avatar
:octocat:
Always be shipping...

Mark Carpenter Jr mcarpenterjr

:octocat:
Always be shipping...
View GitHub Profile
@jelovac
jelovac / README.md
Last active May 7, 2024 14:42
Ubuntu Mate 20.04 XRDP setup

Ubuntu Mate 20.04 XRDP setup

Documenting XRDP setup which worked for me on Ubuntu Mate 20.04.

Some parts are taken from: http://c-nergy.be/blog/?p=14093.

Install xrdp

sudo apt install xrdp
@guycalledseven
guycalledseven / haproxy.md
Last active April 16, 2024 12:40
haproxy conditions

Haproxy conditions

Since I keep forgetting them I've put them here.

To form a condition, you can use the following syntax after the rule that it applies to:

<HAProxy action statement> if|unless [!]acl1 <AND|OR|or|'||'> [!]acl2 ...

  • if - the condition is TRUE if the result of the ACLs is TRUE.
@banzeh
banzeh / monokai-for-windows-terminal-profiles.json
Last active February 13, 2024 10:31
Monokai Theme for Windows Terminal
{
"globals" :
{
"alwaysShowTabs" : true,
"defaultProfile" : "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"initialCols" : 120,
"initialRows" : 30,
"keybindings" :
[
{
@raulqf
raulqf / Install_OpenCV4_CUDA11_CUDNN8.md
Last active May 6, 2024 09:25
How to install OpenCV 4.5 with CUDA 11.2 in Ubuntu 22.04

How to install OpenCV 4.5.2 with CUDA 11.2 and CUDNN 8.2 in Ubuntu 22.04

First of all install update and upgrade your system:

    $ sudo apt update
    $ sudo apt upgrade

Then, install required libraries:

@gaearon
gaearon / modern_js.md
Last active April 18, 2024 15:01
Modern JavaScript in React Documentation

If you haven’t worked with JavaScript in the last few years, these three points should give you enough knowledge to feel comfortable reading the React documentation:

  • We define variables with let and const statements. For the purposes of the React documentation, you can consider them equivalent to var.
  • We use the class keyword to define JavaScript classes. There are two things worth remembering about them. Firstly, unlike with objects, you don't need to put commas between class method definitions. Secondly, unlike many other languages with classes, in JavaScript the value of this in a method [depends on how it is called](https://developer.mozilla.org/en-US/docs/Web/Jav
@mcarpenterjr
mcarpenterjr / bs_btn_gr_tog.js
Last active September 26, 2017 02:09
small reusable function for toggling the visual state of bootstrap button groups, and returning a value based on the selected one. The idea is if it is checkbox we toggle its visual state by changing the background and changing the icon on the button. If it is a radio button group we just change the icon on the target button and reset the icon o…
self.cbTog = function(b) {
var self = this;
var gs = $(b).parent('label').siblings().length;
// console.log($(b).parent('label').siblings().length);
if (gs > 0) {
// This is a multi option item, mostlikely a radio.
$(b)
.siblings('i')
@hoandang
hoandang / php-docker-ext
Created May 20, 2017 01:12
Complete list of php docker ext
RUN apt update
RUN apt upgrade -y
RUN apt install -y apt-utils
RUN a2enmod rewrite
RUN apt install -y libmcrypt-dev
RUN docker-php-ext-install mcrypt
RUN apt install -y libicu-dev
RUN docker-php-ext-install -j$(nproc) intl
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
@Jamesits
Jamesits / caddy.sh
Last active January 27, 2024 14:47
Install Caddy Server on Ubuntu with Systemd.
# Should work on all Debian based distros with systemd; tested on Ubuntu 16.04+.
# This will by default install all plugins; you can customize this behavior on line 6. Selecting too many plugins can cause issues when downloading.
# Run as root (or sudo before every line) please. Note this is not designed to be run automatically; I recommend executing this line by line.
apt install curl
curl https://getcaddy.com | bash -s personal dns,docker,dyndns,hook.service,http.authz,http.awses,http.awslambda,http.cache,http.cgi,http.cors,http.datadog,http.expires,http.filemanager,http.filter,http.forwardproxy,http.geoip,http.git,http.gopkg,http.grpc,http.hugo,http.ipfilter,http.jekyll,http.jwt,http.locale,http.login,http.mailout,http.minify,http.nobots,http.prometheus,http.proxyprotocol,http.ratelimit,http.realip,http.reauth,http.restic,http.upload,http.webdav,net,tls.dns.auroradns,tls.dns.azure,tls.dns.cloudflare,tls.dns.cloudxns,tls.dns.digitalocean,tls.dns.dnsimple,tls.dns.dnsmadeeasy,tls.dns.dnspod,tls.dns.dyn,tls.
@pascalwacker
pascalwacker / mattermost.post.php
Created September 27, 2016 17:50
Mattermost PHP Post example
// target webhook
$target = 'https://dev.bermos.tech/hooks/xxx'; // get your webhook at "Integrationen" at the settings
// message body
$body = "| Course | Time | Room | Video | Prof |\n";
$body .= "|:--|:--|:--|\n";
$body .= "| Test | XX:XX-YY:YY | HG E7 | :white_check_mark: HG E5 | FooBar |\n";
$body .= "| Test 2 | XX:XX-YY:YY | HG E7 | No | FooBar |\n";
$body .= "\n";
// this is an example for a course bot, using a table. Mattermost supports MD
@jwill
jwill / MemeMaker.html
Last active January 23, 2024 23:33
Starter code for Meme Maker
<!DOCTYPE html>
<html>
<head>
<title>MemeMaker-Simple</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<style>