Table of Contents
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Script to update a firewall rule in a Hetzner Firewall with your current IP address. | |
# Good if you would like to restrict SSH access only for your current IP address (secure). | |
################# | |
# WARNING: This script will overwrite all rules in the firewall rules, so make sure you | |
# added all the required rules. | |
# I use a separate firewall rule just for SSH access. | |
################# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fastapi import Request, HTTPException | |
from pydantic import BaseModel, BaseModel, HttpUrl | |
from modal import Secret, App, web_endpoint, Image | |
from typing import Optional, List | |
from example import proposal | |
import os | |
app = App(name="circleback", image=Image.debian_slim().pip_install("openai", "pydantic", "fastapi")) | |
class Attendee(BaseModel): |
This is an opinionated handbook on how I migrated all my Rails apps off the cloud and into VPS.
This is how I manage real production loads for my Rails apps. It assumes:
- Rails 7+
- Ruby 3+
- PostgreSQL
- Ubuntu Server 24.04
- Capistrano, Puma, Nginx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function genBash(masterURL) { | |
var xhr = new XMLHttpRequest(); | |
xhr.open("GET", masterURL, true); | |
xhr.addEventListener("load", function () { | |
var master = JSON.parse(this.responseText); | |
var baseURL = new URL(master.base_url, masterURL); | |
function genBashLines(mp4, type) { | |
var mp4BaseURL = new URL(mp4.base_url, baseURL); | |
var segmentURLs = mp4.segments.map(segment => segment.url); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Viktor's Roam gallery PoC v0.2 | |
* author: @ViktorTabori | |
* | |
* How to install it: | |
* - go to page [[roam/js]] | |
* - create a node with: {{[[roam/js]]}} | |
* - create a clode block under it, and change its type from clojure to javascript | |
* - allow the running of the javascript on the {{[[roam/js]]}} node | |
* - reload Roam |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
hexStringToIntArray: function(str) { | |
var res = [] | |
for(var i = 0; i < str.length; i += 2) { | |
res.push(parseInt(str.substring(i, i+2), 16)) | |
} | |
return res | |
}, | |
byteArrayToHexString: function(array) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/foundation.dart'; | |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(MyApp( | |
items: List<String>.generate(10000, (i) => "Item $i"), | |
)); | |
} | |
class MyApp extends StatefulWidget { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
##################################################### | |
# Name: Bash CheatSheet for Mac OSX | |
# | |
# A little overlook of the Bash basics | |
# | |
# Usage: | |
# | |
# Author: J. Le Coupanec | |
# Date: 2014/11/04 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Update (2022): https://gist.github.com/atyachin/2f7c6054c4cd6945397165a23623987d | |
Steps for installing the Android Emulator from EC2 console: | |
----------------------------------------------------------- | |
sudo apt install default-jdk | |
wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip | |
unzip sdk-tools-linux-4333796.zip -d android-sdk | |
sudo mv android-sdk /opt/ | |
export ANDROID_SDK_ROOT=/opt/android-sdk |
NewerOlder