Skip to content

Instantly share code, notes, and snippets.

@milo
milo / php-oci8-debian.md
Last active June 3, 2024 14:47
PHP Oracle OCI8 extension on Linux Debian

Oracle Instant Client libraries installation

Download Oracle Instant Client libraries (URL may change, already happened few times). Be sure you download correct (x64 or x32) architecture. And correct version.

Last time I used Client 21.5.0.0.0 with Oracle 12c and PHP 8.1 and 8.3.

Before that Instant Client 21.3.0.0.0 with Oracle 12c and compiled with PHP 8.0, 7.4 and 7.3 fine.

Before that Instant Client 10.1.0.5.0 with Oracle 10g, 11g and 12c and PHP 5.6, 7.1, 7.2, 7.3 and 7.4.

Never hit any problem with such setups but my queries are quite simple. One should be fine with the newest version. It should be backward compatible (fingers crossed).

@sayle-doit
sayle-doit / bq_job_editions_cost_comparison_with_autoscaler.sql
Last active June 3, 2024 14:46
Compare BigQuery job costs when running a job on either BigQuery Editions with the autoscaler or on-demand with both new and old pricing models.
/*
* This query will look at the past 30 days of job history to analyze it for costs under
* BigQuery Editions while utilizing the new autoscaling feature that was introduced.
* It does this for those using both PAYG (Pay As You Go) and commitment models.
* It will also compare this versus running the query with the on-demand model.
*
* Note that this query utilizes some math modeling behaviors that the BigQuery
* autoscaler uses. Namely these are the up to 10 seconds "slot scale up time,"
* the minimum of 60 seconds "slot scale down time," and the behavior that the
* autoscaler scales up and down in factors of 100 slots for each job.
@Voloshin-Sergei
Voloshin-Sergei / commit.md
Created November 3, 2020 13:10
Шпаргалка по оформлению коммитов

Требования к именам коммитов

  • Названия коммитов должны быть согласно гайдлайну
  • Должен использоваться present tense ("add feature" not "added feature")
  • Должен использоваться imperative mood ("move cursor to..." not "moves cursor to...")

Примеры имен коммитов

init: - используется для начала проекта/таска. Примеры:
  • init: start youtube-task
  • init: start mentor-dashboard task
@Rsych
Rsych / PlacePicker.swift
Created December 12, 2021 10:59
GooglePlaces picker
import Foundation
import UIKit
import SwiftUI
import GooglePlaces
struct PlacePicker: UIViewControllerRepresentable {
func makeCoordinator() -> Coordinator {
Coordinator(self)
@thejsa
thejsa / discord-aero.css
Created June 1, 2018 01:35
Windows Aero theme for Discord
/** remove grey backgrounds **/
.theme-light .friends-table, .theme-light .messages-wrapper, .theme-light .chat, .channels-Ie2l6A, .guilds-wrapper, .container-2lgZY8, .theme-light .layer-3QrUeG, .theme-light .layers-3iHuyZ, .theme-light .typing-2GQL18,
.theme-light .members-1998pB, .theme-light .chat>.content, .theme-light .title-3qD0b-, .container-PNkimc, .channels-Ie2l6A, #app-mount, .theme-light .chat form, .container-2Thooq, .theme-light .headerBar-UHpsPw,
.theme-light .friends-table .messages .divider:before, .theme-light .friends-table .messages .divider span, .theme-light .messages-wrapper .messages .divider:before, .theme-light .messages-wrapper .messages .divider span, .theme-light #friends
{
background:rgba(0,0,0,0) !important;
}/** remove grey backgrounds **/
.theme-dark .friends-table, .theme-dark .messages-wrapper, .theme-dark .chat, .channels-Ie2l6A, .guilds-wrapper, .container-2lgZY8, .theme-dark .layer-3QrUeG, .theme-dark .layers-3iHuyZ, .theme-dark .typing-2GQL18,
.theme-dark .members-199
#!/bin/bash
# based on https://www.tuicool.com/articles/7jaAZj
# but works with GPT (3TB disks) and auto-inherits IP from rescue host.
set -e
DEVS='/dev/sda /dev/sdb'
ROOT=${ROOT:-/mnt}
ROOT_DEV=${ROOT_DEV:-/dev/md0}
@firelightning13
firelightning13 / [GUIDE] GPU Passthrough for Laptop with Fedora.md
Last active June 3, 2024 14:45
[GUIDE] GPU Passthrough for Laptop with Fedora

Abstract

This is a full guide for people who wanted to setup Windows 10/11 VM with QEMU/KVM hypervisor for laptops that configured with hybrid graphics card like Intel/AMD + NVIDIA. This process will take about 1 to 2 hours, depending on your system's performance.

There is another comprehensive guide you can follow here (shoutout to asus-linux team). It is more up-to-date than mine. I'll probably incorporate those information to my guide, but you are welcome to use this one as a reference!

Before we proceed:

  • This guide is exclusively for Fedora because this distro is quite different to set up than other distro such as Arch. I would say Arch is easier to setup than Fedora, but sometimes your prefer Fedora than Arch in terms of its usage & features.
  • This tutorial mostly focus on laptops with NVIDIA Optimus MUXed configuration when dGPU (dedicated GPU) can connect directly to HDMI/DP output. If in doubt, sea
@Kautenja
Kautenja / fuse_normalize_into_conv2d.py
Created May 16, 2023 15:57
A PyTorch method for fusing normalization statistics directly into a convolutional layer
import torch
from torch.nn import Conv2d
@torch.no_grad()
def fuse_normalize_into_conv_2d(conv: Conv2d, mean: torch.Tensor, std: torch.Tensor) -> Conv2d:
"""
Fuse normalization statistics into a convolutional layer.
Args:
@straker
straker / README.md
Last active June 3, 2024 14:40
Basic Pong HTML and JavaScript Game

Basic Pong HTML and JavaScript Game

This is a basic implementation of the Atari Pong game, but it's missing a few things intentionally and they're left as further exploration for the reader.

Further Exploration

  • Score
  • When a ball goes past a paddle, the other player should score a point. Use context.fillText() to display the score to the screen