Skip to content

Instantly share code, notes, and snippets.

@madduci
madduci / ftth_openwrt.md
Last active May 4, 2024 23:05
Deutsche Telekom FTTH Access with OpenWRT

Configuring Deutsche Telekom FTTH Access with OpenWRT

After looking for alternatves to the suggested Router from Telekom (AVM FritzBox and HUawei Speedport), I've discovered the possibility of configuring my existing OpenWRT Router to act as gateway to the Telekom FTTH (Fiber To The Home) Magenta Zuhause package.

TL;DR

The WAN interface must be configured as follows (see your Telekom letter):

  • Protocol: PPPoE
  • PAP/CHAP username:
@addyosmani
addyosmani / preprocessing.md
Last active May 4, 2024 23:04
JavaScript preprocessing/precompilation

Problem: How can we preprocess JavaScript (at build-time or on the server-side) so engines like V8 don't have to spend as much time in Parse? This is a topic that involves generating either bytecode or a bytecode-like-abstraction that an engine would need to accept. For folks that don't know, modern web apps typically spend a lot longer in Parsing & Compiling JS than you may think.

  • Yoav: This can particularly be an issue on mobile. Same files getting parsed all the time for users. Theoretically if we moved the parsing work to the server-side, we would have to worry about it less.
  • One angle to this problem is we all ship too much JavaScript. That's one perspective. We could also look at preprocessing.
  • We've been talking about this topic over the last few weeks a bit with V8. There were three main options proposed.
    1. Similar to what optimize-js does. Identify IIFEs and mark them as such so the browser and VMs heuristics will catch them and do a better job than today. optimize-js only tackles IIFE bu
@imba-tjd
imba-tjd / .Cloud.md
Last active May 4, 2024 22:58
☁️ 一些免费的云资源

IaaS指提供系统(可以自己选)或者储存空间之类的硬件,软件要自己手动装;PaaS提供语言环境和框架(可以自己选);SaaS只能使用开发好的软件(卖软件本身);BaaS一般类似于非关系数据库,但各家不通用,有时还有一些其它东西。

其他人的集合

@merolhack
merolhack / backup-mysql.bat
Created April 14, 2016 15:56
Windows: Backup all databases in a MySQL server.
@ECHO off
SETLOCAL ENABLEDELAYEDEXPANSION
REM Windows Batch script to backup all mysql databases in a server
REM @author: Lenin Meza <lenin.meza.externo@prodecon.gob.mx>
REM Database information
SET dbhost="127.0.0.1"
SET dbuser="root"
# Install prerequisites
sudo apt-get -y update
sudo apt-get -y install ca-certificates curl gnupg lsb-release
# Setup Docker's repository
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get -y update
@hrishipoola
hrishipoola / peloton-s-implied-volatility-delta-hedge.ipynb
Created February 22, 2021 15:42
Peloton's Implied Volatility & Delta Hedge.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@LeviSnoot
LeviSnoot / discord-timestamps.md
Last active May 4, 2024 22:45
Discord Timestamp Syntax

Discord Timestamps

Discord timestamps can be useful for specifying a date/time across multiple users time zones. They work with the Unix Timestamp format and can be posted by regular users as well as bots and applications.

The Epoch Unix Time Stamp Converter is a good way to quickly generate a timestamp. For the examples below I will be using the Time Stamp of 1543392060, which represents November 28th, 2018 at 09:01:00 hours for my local time zone (GMT+0100 Central European Standard Time).

Formatting

Style Input Output (12-hour clock) Output (24-hour clock)
Default <t:1543392060> November 28, 2018 9:01 AM 28 November 2018 09:01
import wx
class CustomFrame(wx.Frame):
def __init__(self, parent, title, image_dimensions):
super(CustomFrame, self).__init__(parent, title=title, style=wx.NO_BORDER)
self.SetBackgroundColour(wx.Colour(255, 255, 255)) # Set background color
# Load custom window images
self.SetIcon(wx.Icon("window_icon.ico", wx.BITMAP_TYPE_ICO))
self.frame_images = {
@runiq
runiq / .bash_profile
Created January 20, 2021 00:04
How I handle envvars
[[ -f "$HOME/.profile" ]] && source "$HOME/.profile"
[[ $- == *i* && -f "$HOME/.bashrc" ]] && source "$HOME/.bashrc"
import wx
class CustomFrame(wx.Frame):
def __init__(self, parent, title):
super(CustomFrame, self).__init__(parent, title=title, style=wx.DEFAULT_FRAME_STYLE)
# Load custom window images
self.SetIcon(wx.Icon("window_icon.ico", wx.BITMAP_TYPE_ICO))
self.SetBackgroundColour(wx.Colour(255, 255, 255)) # Set background color