Skip to content

Instantly share code, notes, and snippets.

View hahouari's full-sized avatar

Hocine Abdellatif Houari hahouari

View GitHub Profile
@hahouari
hahouari / Dockerfile
Created November 20, 2023 23:03
Dockerfile for Sveltekit with pnpm
FROM node:20-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
COPY . /app
WORKDIR /app
FROM base AS prod-deps
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
// ...
// ... The previous segment
// ...
Column(modifier = modifier.systemBarsPadding()) {
Row(
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.SpaceBetween,
modifier = Modifier
.fillMaxWidth()
@Composable
fun MyScreen(modifier: Modifier = Modifier) {
// ...
// ... other variables
// ...
val configuration = LocalConfiguration.current
val scope = rememberCoroutineScope()
val interactionSource = remember { MutableInteractionSource() }
val indication = rememberRipple(
// if set false, the ripple effect will not be cropped to the button.
@hahouari
hahouari / 1_rotation_in_ffmpeg.py
Last active November 5, 2022 11:12
Detect video rotation using ffmpeg and cv2 in python
import ffmpeg
def get_rotation(video_file_path: str):
try:
# fetch video metadata
metadata = ffmpeg.probe(video_file_path)
except Exception as e:
print(f'failed to read video: {video_file_path}\n'
f'{e}\n',
end='',
database:
container_name: my_database
restart: always
image: postgres:13-alpine
user: '0:0'
ports:
- '5435:5432'
env_file:
- $PWD/.env
volumes:
@hahouari
hahouari / genetic-py-x64-package.json
Last active April 14, 2022 15:02
package.json for dist:w for both installer and portable
{
...
"scripts": {
...
"build": "./node_modules/.bin/electron-builder",
"dist:w": "yarn build -w --x64 && mv dist/GeneticPy.exe dist/GeneticPy-x64.exe && mv dist/GeneticPy-Installer.exe dist/GeneticPy-Installer-x64.exe && yarn build -w --ia32 && mv dist/GeneticPy.exe dist/GeneticPy-ia32.exe && mv dist/GeneticPy-Installer.exe dist/GeneticPy-Installer-ia32.exe"
},
...
}
@hahouari
hahouari / package.json
Last active April 26, 2020 23:17
package.json for dist:w for installer only
{
...
"scripts": {
...
"build": "./node_modules/.bin/electron-builder",
"dist:w": "yarn build -w --x64 && mv dist/GeneticPy-Installer.exe dist/GeneticPy-Installer-x64.exe && yarn build -w --ia32 && mv dist/GeneticPy-Installer.exe dist/GeneticPy-Installer-ia32.exe",
},
...
}
@hahouari
hahouari / package.json
Last active April 26, 2020 22:25
package.json build script
{
...
"scripts": {
...
"build": "./node_modules/.bin/electron-builder"
},
...
}
@hahouari
hahouari / genetic-py-electron-builder.yaml
Last active April 14, 2022 14:45
electron-builder important parts
productName: GeneticPy
artifactName: ${productName}-${arch}.${ext}
win:
target:
- nsis
- portable
nsis:
artifactName: ${productName}-Installer.${ext}
@hahouari
hahouari / com.ubuntu.pkexec.xampp.policy
Created May 23, 2019 19:31 — forked from JQL/com.ubuntu.pkexec.xampp.policy
How to use pkexec to add XAMPP to the Linux Mint Menu. Note, it also works on Ubuntu and Ubuntu Mate with suitable changes.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN" "http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
<policyconfig>
<vendor>Apache Friends</vendor>
<vendor_url>https://www.apachefriends.org/index.html</vendor_url>
<icon_name>xampp</icon_name>
<action id="com.ubuntu.pkexec.xampp.policy">
<description>Run XAMPP Control Panel</description>
<message>Authentication is required to run the XAMP Control Panel</message>