Skip to content

Instantly share code, notes, and snippets.

@iambryancs
iambryancs / pyenv-wsl-ubuntu_22.04.md
Created May 31, 2023 10:31
Using Pyenv in WSL Ubuntu 22.04 LTS to install Python 3.8

Using Pyenv in WSL Ubuntu 22.04 LTS to install Python 3.8

Env

  • Windows 10
  • Ubuntu 22.04 WSL
  • zsh

Requirements

  • git
@rcarrata
rcarrata / hcp-rosa.md
Last active April 16, 2024 21:14
Hosted Control Planes for ROSA HCP

HyperShift

  • Set environment variables
CLUSTER_NAME="rosa-hcp-rcs"
PREFIX_NAME="hcp-rcs"
REGION="us-east-1"
VERSION="4.14.9"
USER=rcarrata
nodes:
- id: webcam
custom:
source: https://huggingface.co/datasets/dora-rs/dora-idefics2/raw/main/operators/opencv_stream.py
outputs:
- image
- id: idefics2
operator:
python: https://huggingface.co/datasets/dora-rs/dora-idefics2/raw/main/operators/idefics2_op.py
inputs:

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Create Free AWS Account

Create free AWS Account at https://aws.amazon.com/

2. Create and Lauch an EC2 instance and SSH into machine

I would be creating a t2.medium ubuntu machine for this demo.

@vlsi
vlsi / 00_conclusions.md
Last active April 16, 2024 21:10
The fastest way of string concatenation in Oracle PL/SQL

When builing large strings with lots of concatenations in PL/SQL, custom approach like "use varchar2(32000) buffer to reduce the number of dbms_lob calls" makes sense even for Oracle 12.1.0.2.0.

The response time improvement is 4..300+ times :) depending on the DB version and API you use.

Note that simple v_clob || TO_CHAR (SYSTIMESTAMP) || ', ' ==> v_clob || TO_CLOB(TO_CHAR (SYSTIMESTAMP) || ', ') trick (note the extra to_clob) makes 24 times improvement for 11g. The trick is bad for 12c where results in 1.5x degradation.

The code was published 4 year ago as an answer to "How to Quickly Append VARCHAR2 to CLOB": http://www.talkapex.com/2009/06/how-to-quickly-append-varchar2-to-clob.html?showComment=1343235921606#c9077980873875311325

@jack3898
jack3898 / guide.md
Last active April 16, 2024 21:07
How to authenticate with FakeYou using a username and password

How to authenticate with the FakeYou API without an API key

FakeYou's API does not have public support for an API key so unless you have been given an API token by the owner, you're left with session authentication.

This guide will predominantly revolve around TypeScript, but in the end, we will be using HTTP as our transfer protocol. So long as your language works with HTTP, you should be able to translate it to your language of choice!

Understanding how to authenticate

We will use session authentication, which means you need to send across a cookie to the API so that FakeYou recognises you.

@Razer6
Razer6 / modelsim_installation.md
Last active April 16, 2024 21:06 — forked from robodhruv/modelsim_installation.md
Installing ModelSim on Ubuntu

ModelSim Installation on Ubuntu

Installation requirements

The free version of Modelsim is a 32-bit binary and therefore requires certain 32-bit libraries in order to work correctly. For Ubunutu, install the following packages

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32ncurses6 libxft2 libxft2:i386 libxext6 libxext6:i386 
@arcaravaggi
arcaravaggi / update_migrate.R
Last active April 16, 2024 21:06
Update R and migrate R packages to new installation from within the console
#From https://stackoverflow.com/questions/1401904/painless-way-to-install-a-new-version-of-r
# Run in the old version of R (or via RStudio)
setwd("C:/Temp/")
packages <- installed.packages()[,"Package"]
save(packages, file="Rpackages")
# INSTALL NEW R VERSION
if(!require(installr)) { install.packages("installr"); require(installr)} #load / install+load installr
# See here for more on installr: https://www.r-statistics.com/2013/03/updating-r-from-r-on-windows-using-the-installr-package/
@maptastik
maptastik / fileList.py
Last active April 16, 2024 21:05
Create a Markdown formatted list of files in a directory
```
Create a Markdown formatted list of files in a directory
```
import os
dir = input("Directory to generate list: ")
list = os.listdir(dir)
file = open(dir + '\\' + 'list.txt', 'w')
for l in list:
//
// ContentView.swift
// HSplitView
//
// Created by Shadowfacts on 4/16/24.
//
import SwiftUI
struct ContentView: View {