Skip to content

Instantly share code, notes, and snippets.

View te-online's full-sized avatar

Thomas Ebert te-online

View GitHub Profile
@acutmore
acutmore / ts-blank-space-doc.md
Last active July 19, 2024 17:16
Learnings from 'ts-blank-space`

Learnings from ts-blank-space

tags: TypeScript, type erasure, type stripping

ts-blank-space

As part of my work on the JavaScript Tooling team at Bloomberg I have implemented an experimental (not yet used in production) package to transform TypeScript into JavaScript using a somewhat novel approach.

This is a description of what I learned from implementing the idea. The source code will be open sourced soon - it just needs some regular IP approval.

import React from "react";
import { InjectedFormProps, reduxForm } from "redux-form";
type FormType = {
input1: string;
};
type ComponentProps = {};
type InjectedProps = InjectedFormProps<FormType, ComponentProps>;
@muety
muety / vpn.md
Created November 17, 2018 06:32
Use FritzBox IPSec VPN on Ubuntu 18.04

FritzBox VPN on Ubuntu 18.04

  • Configure VPN for a user on your FritzBox and don't forget to show the pop-up including your credentials etc. afterwards. Also make sure you check "Allow access from internet".
  • sudo apt install vpnc network-manager-vpnc
  • Create file /etc/vpnc/vpn.conf, paste the following content and insert your credentials etc.
IPSec gateway yourfritzboxhere.myfritz.net
IPSec ID your_user
IPSec secret your_preshared_key
@taija
taija / uptime-robot-microsoft-teams
Created May 15, 2017 14:31
Webhook for integrating Uptime Robot with Microsoft Teams
{
"text": " *alertDetails* - ID: *monitorID*. URL: [*monitorURL*](*monitorURL*)",
"title": "*monitorFriendlyName* is *alertTypeFriendlyName*"
}
@eladnava
eladnava / mongodb-s3-backup.sh
Last active March 11, 2024 10:21
Automatically backup a MongoDB database to S3 using mongodump, tar, and awscli (Ubuntu 14.04 LTS)
#!/bin/sh
# Make sure to:
# 1) Name this file `backup.sh` and place it in /home/ubuntu
# 2) Run sudo apt-get install awscli to install the AWSCLI
# 3) Run aws configure (enter s3-authorized IAM user and specify region)
# 4) Fill in DB host + name
# 5) Create S3 bucket for the backups and fill it in below (set a lifecycle rule to expire files older than X days in the bucket)
# 6) Run chmod +x backup.sh
# 7) Test it out via ./backup.sh
@remarkablemark
remarkablemark / README.md
Last active June 8, 2024 21:48
Classes - ES5 vs ES6

JavaScript Classes - ES5 vs ES6

An example that shows the difference between creating a JavaScript class and subclass in ES5 and ES6.

Reference

@kjbrum
kjbrum / wp_remove_h1_from_editor.php
Last active November 2, 2022 19:07
Remove h1 from the WordPress editor.
<?php
/**
* Remove the h1 tag from the WordPress editor.
*
* @param array $settings The array of editor settings
* @return array The modified edit settings
*/
function remove_h1_from_editor( $settings ) {
$settings['block_formats'] = 'Paragraph=p;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre;';
return $settings;
@Blake-C
Blake-C / wordpress-id-slug-functions.php
Last active September 10, 2021 17:37
Get WordPress Current Page Slug / Parent Slug / Parent ID
<?php
function the_parent_slug() {
global $post;
if($post->post_parent == 0) return '';
$post_data = get_post($post->post_parent);
return $post_data->post_name;
}
function the_current_page_slug() {
@loorlab
loorlab / disable_zlib.output_compression
Last active March 30, 2021 12:35
Disable zlib.output_compression on WordPress : Notice: ob_end_flush(): failed to send buffer of zlib output compression (1) in /path/wp-includes/functions.php on line 3282 via https://core.trac.wordpress.org/ticket/18525
SOLUTIONS I have came across so far:
======================== SOLUTION 1 ====================
In plugins (or somewhere) you probably have this code:
ini_set('zlib.output_compression', '1');
so, I replaced that code with
@Vestride
Vestride / encoding-video.md
Last active June 5, 2024 14:38
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus