Skip to content

Instantly share code, notes, and snippets.

View osamaAbdullah's full-sized avatar
🎯
Focusing

osama osamaAbdullah

🎯
Focusing
  • Aso
  • iraq
View GitHub Profile
#!/bin/sh
SERVICES=$(echo "$DEPENDENCIES" | tr "|" "\n")
resolve()
{
for SERVICE in $SERVICES; do
ip=$(nslookup "$SERVICE" | awk '/^Address: / { print $2 }')
version: '3.3'
services:
certbot:
image: certbot/certbot
entrypoint: "certbot certonly --standalone --non-interactive --preferred-challenges http --email [email protected] --agree-tos -d x.com,x.x.com"
volumes:
- ./letsencrypt:/etc/letsencrypt
ports:
- 80:80
@osamaAbdullah
osamaAbdullah / suspense
Created December 5, 2022 19:21
suspense with async data fetching
import { Suspense } from 'react';
export default function Test() {
return (
<Suspense fallback={<h1>Loading...</h1>}>
<Shows />
</Suspense>
);
}
function walker({name}) {
return {
walk: () => console.log(name + ' can walk'),
}
}
function attacker({name}) {
return {
attack: () => console.log(name + ' can attack'),
}
}
@osamaAbdullah
osamaAbdullah / csvImportToDB.php
Created July 17, 2020 23:25
reading csv file and inserting it in the database
public function importCsv($model, $fileName)
{
$model = '\\App\\Models\\' . $model;
$file = public_path('csv/' . $fileName . '.csv');
$arr = $this->csvToArray($file);
foreach ($arr as $row)
{
unset($row['id']);