Skip to content

Instantly share code, notes, and snippets.

@mirhec
mirhec / markdown-import.php
Created April 21, 2021 21:00 — forked from vlucas/markdown-import.php
Imports Markdown files in a local directory into a WordPress installation
<?php
// Turn on all error reporting so we can see if anything goes wrong
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(-1);
// Relative path to your wp-config.php file (to connect to the database)
require '../wp-config.php';
require './frontmatter.php'; // Parses YAML frontmatter - https://github.com/Modularr/YAML-FrontMatter
require './Parsedown.php'; // Markdown parser - https://github.com/erusev/parsedown

How to setup AWS lambda function to talk to the internet and VPC

I'm going to walk you through the steps for setting up a AWS Lambda to talk to the internet and a VPC. Let's dive in.

So it might be really unintuitive at first but lambda functions have three states.

  1. No VPC, where it can talk openly to the web, but can't talk to any of your AWS services.
  2. VPC, the default setting where the lambda function can talk to your AWS services but can't talk to the web.
  3. VPC with NAT, The best of both worlds, AWS services and web.
@mirhec
mirhec / Ini.cs
Last active February 13, 2017 14:15 — forked from Larry57/ini.cs
A single class to read and write INI files.
using System;
using System.Collections.Generic;
using System.Linq;
internal class Ini
{
private readonly Dictionary<string, Dictionary<string, string>> _ini = new Dictionary<string, Dictionary<string, string>>(StringComparer.InvariantCultureIgnoreCase);
private string CurrentSection { get; set; } = "";
public Ini(string iniContents)
@mirhec
mirhec / install_fish_debian.sh
Created December 21, 2016 20:09 — forked from mamiu/install_fish_debian.sh
Install fish shell in Debian 8 (commands from the original fish shell website).
#!/bin/bash
echo 'deb http://download.opensuse.org/repositories/shells:/fish:/release:/2/Debian_8.0/ /' >> /etc/apt/sources.list.d/fish.list
apt-get update
wget -qO - http://download.opensuse.org/repositories/shells:fish:release:2/Debian_8.0/Release.key | apt-key add -
apt-get update
apt-get install -y fish
@mirhec
mirhec / install_fish.sh
Last active December 12, 2016 15:55 — forked from mamiu/install_fish.sh
Fish shell installer for uberspace.
#!/bin/bash
cd ~
# install linuxbrew
git clone https://github.com/Linuxbrew/brew.git ~/.linuxbrew
echo "PATH=\"$HOME/.linuxbrew/bin:$PATH\"" >> ~/.bashrc
echo "MANPATH=\":$HOME/.linuxbrew/share/man:$MANPATH\"" >> ~/.bashrc
echo "INFOPATH=\"$HOME/.linuxbrew/share/info:$INFOPATH\"" >> ~/.bashrc