Skip to content

Instantly share code, notes, and snippets.

GENERATE PROJECT:
> composer create-project symfony/skeleton "project_name"
> composer create-project symfony/website-skeleton "project_name"
COMPOSER COMMANDS:
> composer update
wget https://getcomposer.org/installer
chmod +x installer && php ./installer
mv composer.phar /usr/local/bin/composer
echo 'export PATH="~/.config/composer/vendor/bin:$PATH"' >> .bashrc
rm -f installer
--- Windows Powershell [Administrator]
choco install php composer nvm sqlite mysql
---
@freddan88
freddan88 / sc01.js
Created November 18, 2020 15:10
Node.js solution
const fs = require("fs");
const puzzleInput = "172851-675869";
const RANGE = puzzleInput.split("-");
const LOWER = RANGE[0].length === 6 ? parseInt(RANGE[0]) : 0;
const HIGHER = RANGE[1].length === 6 ? parseInt(RANGE[1]) : 0;
if (!LOWER || !HIGHER) return;
let possiblePasswords = [];
if (fs.existsSync("./passwords.txt")) {
fs.unlinkSync("./passwords.txt");

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

@freddan88
freddan88 / mysqldump.php
Created February 4, 2019 11:39 — forked from micc83/mysqldump.php
Simple PHP script to dump a MySql database
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$database = 'db';
$user = 'user';
$pass = 'pass';
$host = 'localhost';