Skip to content

Instantly share code, notes, and snippets.

@mgt95
mgt95 / gist:7c7a9f31c5bebedbc58e12db648a44bc
Created February 18, 2025 14:06 — forked from janeklb/gist:4761535
PHP: array to object
<?php
# Simple loop copy
function loop_copy($array) {
$object = new stdClass();
foreach ($array as $key => $value) {
$object->$key = $value;
}
}
@bradtraversy
bradtraversy / docker_wordpress.md
Last active April 17, 2025 05:13
Docker Compose FIle For Wordpress, MySQL & phpmyadmin

Wordpress & Docker

This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command

$ docker-compose up -d

# To Tear Down
$ docker-compose down --volumes
@bradtraversy
bradtraversy / ssh.md
Last active March 19, 2025 18:14
SSH & DevOps Crash Course Snippets

SSH Cheat Sheet

This sheet goes along with this SSH YouTube tutorial

Login via SSH with password (LOCAL SERVER)

$ ssh [email protected]

Create folder, file, install Apache (Just messing around)

$ mkdir test

$ cd test

@bradtraversy
bradtraversy / myscript.sh
Last active April 6, 2025 12:15
Basic Shell Scripting
#! /bin/bash
# ECHO COMMAND
# echo Hello World!
# VARIABLES
# Uppercase by convention
# Letters, numbers, underscores
NAME="Bob"
# echo "My name is $NAME"
@janeklb
janeklb / gist:4761535
Last active February 18, 2025 14:06
PHP: array to object
<?php
# Simple loop copy
function loop_copy($array) {
$object = new stdClass();
foreach ($array as $key => $value) {
$object->$key = $value;
}
}
@arbo77
arbo77 / MyFrame.java
Created August 10, 2012 23:38
Simple Java GUI example
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class MyFrame extends JFrame {
private JButton btnTutup = new JButton("Tutup");
private JButton btnTambah = new JButton("Tambah");
private JTextField txtA = new JTextField();