Skip to content

Instantly share code, notes, and snippets.

@mhwh-dev
mhwh-dev / Database.php
Created April 18, 2024 13:23 — forked from Sentinel17/Database.php
Домашнее задание №11
<?php
class Database{
public $isConn;
protected $data;
public function __construct($username = "root", $password = "", $host = "127.0.0.1", $dbname = "test", $options = []){
$this->isConn = TRUE;
$this->data = new PDO("mysql:host=$host;dbname=$dbname;charset=utf8", $username, $password, $options);
$this->data->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$this->data->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
@willianfalbo
willianfalbo / README.md
Last active April 18, 2024 13:22
Expanding disk inside Hyper-V using Linux Virtual Machine (Ubuntu)

Expanding disk inside Hyper-V using Linux Virtual Machine (Ubuntu)

  1. Turn off your virtual machine

  2. Go to Settings > SCSI Controller > Hard Drive. In the Media section, edit the Virtual Hard Disk and expand to desired space

  3. Start the virtual machine and connect to it

  4. Install the GParted by running the command sudo apt install gparted

@rxaviers
rxaviers / gist:7360908
Last active April 18, 2024 13:19
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@z11i
z11i / upload.sh
Last active April 18, 2024 13:18
Use curl to upload a file in a multipart/form-data request, with custom content-type for the file (not the request)
filename='yourfilename'
filetype='text/csv'
token='my oauth token'
url='http://localhost/upload'
curl "$url" \
--form "data=@$filename;type=$filetype" \
--form "name=somename" \
-H "Authorization: Bearer $token"
@bmaupin
bmaupin / free-database-hosting.md
Last active April 18, 2024 13:16
Free database hosting
@cayter
cayter / repository.ts
Last active April 18, 2024 13:16
Drizzle ORM Type-Safe Repository With PgTable
import { startSpan } from "@sentry/remix";
import type { StartSpanOptions } from "@sentry/types";
import {
type AnyColumn,
type AnyTable,
type BuildQueryResult,
type DBQueryConfig,
type DrizzleTypeError,
type Equal,
type ExtractTablesWithRelations,
@agl
agl / gist:876829
Created March 18, 2011 21:00
Proxy server for testing revocation
package main
import (
"bufio"
"fmt"
"io"
"net"
"strings"
)

Tcpdump is a CLI tool to capture raw network packets. This is useful for various forms of network troubleshooting. This cheat sheet covers all the basic and advanced options for tcpdump.

Tcpdump cheat sheet

how-to-use-tcpdump

Tcpdump command is a famous network packet analyzing tool that is used to display TCP\IP & other network packets being transmitted over the network attached to the system on which tcpdump has been installed. Tcpdump uses libpcap library to capture the network packets & is available on almost all Linux/Unix flavors.

Capture ICMP Packets With Tcpdump

@rmcdongit
rmcdongit / macOS_SytemPrefs.md
Last active April 18, 2024 13:13
Apple System Preferences URL Schemes

macOS 10.15 System Preference Panes

Below are a list of System Preference pane URLs and paths that can be accessed with scripting to assist users with enabling macOS security settings without having to walk them through launching System Preferences, finding panes, and scrolling to settings. Not all panes have an accessible anchor and some are OS specific.

To find the Pane ID of a specific pane, open the System Preferences app and select the desired Preference Pane. With the pane selected, open the ScriptEditor.app and run the following script to copy the current Pane ID to your clipboard and display any available anchors:

tell application "System Preferences"
	set CurrentPane to the id of the current pane
	set the clipboard to CurrentPane