Skip to content

Instantly share code, notes, and snippets.

View locvfx's full-sized avatar

Dylan Lopez locvfx

View GitHub Profile
@locvfx
locvfx / Query helper methods
Last active January 16, 2024 15:22
Codeigniter - Query builder #database
$this->db->insert_id()
//The insert ID number when performing database inserts.
$this->db->affected_rows()
//Displays the number of affected rows, when doing “write” type queries (insert, update, etc.).
$this->db->last_query()
//Returns the last query that was run (the query string, not the result). Example:
$this->db->count_all()
@locvfx
locvfx / marketplace.sol
Created December 25, 2023 11:12 — forked from dabit3/marketplace.sol
NFT Marketplace Smart Contract (V2)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "hardhat/console.sol";
contract NFTMarketplace is ERC721URIStorage {
@locvfx
locvfx / get-host-name
Created September 6, 2023 12:50
get hostname in PHP
function getHost($url) {
$parseUrl = parse_url(trim($url));
if(isset($parseUrl['host']))
{
$host = $parseUrl['host'];
}
else
{
$path = explode('/', $parseUrl['path']);
$host = $path[0];
@locvfx
locvfx / index.php
Last active September 3, 2023 15:19 — forked from uhtred/placeholdit.php
PHP: Placehold it image
<?php
/*
How to use
/940x278
/940x278/000000
/940x278&text=Texto
/940x278/000000&text=Texto
RewriteEngine On
@locvfx
locvfx / extract_file.php
Last active August 25, 2023 03:38 — forked from GoldenEra/functions.php
php:extract zip and rar file
/**
* extract rar or zip file
*
* @since [1.0]
* @author Richard
* @date 2015-05-05
*
* @param [string] $file_path ["D:\file\path\a.rar"]
* @param [string] $to_path ["D:\extract\to\path"]
* @return [boolean]
@locvfx
locvfx / delete-from-v2-docker-registry.md
Created August 25, 2023 03:27 — forked from jaytaylor/delete-from-v2-docker-registry.md
One liner for deleting images from a v2 docker registry
#!/usr/bin/env bash
# Credits (based on): J. Elliot Taylor https://gist.github.com/jaytaylor/86d5efaddda926a25fa68c263830dac1
# Changes:
# - iterate over tag list instead of using only first one
# - optional: basic auth
set -e
set -o pipefail
readonly VER=1.0.0
@locvfx
locvfx / index.html
Created May 22, 2019 04:31 — forked from jrue/index.html
HTML & CSS Wheel Of Fortune / Bingo Game
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Wheel of Fortune Bingo</title>
<!--
MIT License
@locvfx
locvfx / sendy-server
Created August 5, 2023 04:14 — forked from refringe/sendy-server
Nginx configuration file example for Sendy (http://sendy.co/).
server {
listen 80;
listen [::]:80;
server_name domain.com;
autoindex off;
index index.php index.html;
root /srv/www/domain.com/public;
@locvfx
locvfx / Sendy Nginx Config
Created August 5, 2023 04:06 — forked from amanjuman/Sendy Nginx Config
Sendy Nginx Config for PHP7.4 FPM
sudo su
//Setup Hostname
hostnamectl set-hostname subdomain.domain.tld
## Basic
sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get autoremove -y && sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php -y && add-apt-repository ppa:nginx/stable -y
//Setup SWAP
sudo fallocate -l 1G /swapfile;
@locvfx
locvfx / dark-mode.css
Created September 2, 2022 14:15 — forked from ijason/dark-mode.css
Dark mode for Bootstrap 3. Combining dark mode switcher (https://github.com/coliff/dark-mode-switch) with Darkly theme (https://bootswatch.com/3/darkly/bootstrap.css). Work in progress.
[data-theme="dark"] {
background-color: #111 !important;
color: #eee;
}
[data-theme="dark"] .bg-light {
background-color: #333 !important;
}
[data-theme="dark"] .bg-white {