A long time ago in a galaxy far, far away....
if (condition) doSomething(); else if (!condition) doSomethingElse();
if (condition) doSomething(); else doSomething();
import functools | |
from typing import Annotated, Any, Callable, Protocol, Type, TypeVar | |
from fastapi import APIRouter, Depends, FastAPI, Request | |
import punq | |
# domain - no dependency to FastAPI or IoC | |
class Greeter(Protocol): | |
def greet(self) -> str: ... |
A long time ago in a galaxy far, far away....
if (condition) doSomething(); else if (!condition) doSomethingElse();
if (condition) doSomething(); else doSomething();
<?php | |
$query_string = $_SERVER['QUERY_STRING']; | |
$fp = fopen("dllist.txt", "a"); | |
flock($fp, LOCK_EX); | |
fputs($fp, $query_string); | |
fputs($fp, "\n"); | |
flock($fp, LOCK_UN); | |
fclose($fp); | |
print("Saved."); | |
?> |
#!/bin/bash | |
cd ~/Downloads/auto/ | |
echo "============================" >> log.txt | |
echo "[$(date)] script launched" >> log.txt | |
echo "[$(date)] renewing dllist.txt" >> log.txt | |
rm dllist.txt | |
wget --user=folani --password=passwordesh melmi.ir/downloads/dllist.txt |
PROJNAME = your_project_name | |
SRCDIR = src | |
OBJDIR = bin | |
DEPDIR = bin | |
BINDIR = bin | |
CXX = g++ | |
CXXFLAGS = -O3 -std=c++14 | |
LDFLAGS = |
<?php | |
$fp = fopen("log.txt", "a"); | |
flock($fp, LOCK_EX); | |
$timezone = 'Asia/Tehran'; | |
date_default_timezone_set($timezone); | |
$date = date('m/d/Y h:i:s a', time()); | |
fputs($fp, "TIME: $date\n"); | |
$timezone = date_default_timezone_get(); | |
fputs($fp, "TIMEZONE: $timezone\n"); |
#!/usr/bin/env bash | |
basedir="/git/" | |
access_group="developers" | |
show_err() { | |
echo | |
echo "add-repo: an error occured." | |
echo | |
echo "Usage:" |
[ | |
{"keys": ["ctrl+shift+c"], "command": "exec", "args": {"kill": true} } , | |
{"keys": ["ctrl+shift+l"], "command": "build", "args": {"variant": "Clean"} } | |
] |