Skip to content

Instantly share code, notes, and snippets.

View EdwardNavarro's full-sized avatar
🎯
Focusing

Edward Navarro EdwardNavarro

🎯
Focusing
View GitHub Profile
@EdwardNavarro
EdwardNavarro / ascii_arty.py
Created May 14, 2019 21:57 — forked from jdiaz5513/ascii_arty.py
Console ASCII Art Generator
#! /usr/bin/env python2
# Requires: PIL, colormath
#
# Improved algorithm now automatically crops the image and uses much
# better color matching
from PIL import Image, ImageChops
from colormath.color_conversions import convert_color
from colormath.color_objects import LabColor
from colormath.color_objects import sRGBColor as RGBColor
@EdwardNavarro
EdwardNavarro / gist:16327a0117b85ac10c6c421cd217d7a7
Created May 18, 2019 16:53 — forked from johnmorris/gist:8135167
A simple database class using mysqli prepared statements in PHP.
<?php
if ( !class_exists( 'DB' ) ) {
class DB {
public function __construct($user, $password, $database, $host = 'localhost') {
$this->user = $user;
$this->password = $password;
$this->database = $database;
$this->host = $host;
}
protected function connect() {
# Version 1.2 :: This script reads offline event logs, oldest to newest, bottom to top.
# See http://www.trimideas.com/2015/04/auditing-changed-deleted-files.html for instructions.
$LogPath = "C:\Event_Logs\"
$ReportPath = "C:\Audit\File-Audit-Reports\"
$Formatted_Date = (Get-Date -UFormat %A-%B-%d-at-%I-%M-%S%p)
$ZipName = "Security-Events-for-" + (Get-Date -UFormat %A-%B-%d) + ".zip"
$Report_in_CSV = $ReportPath + "Audit of changed files on " + $Formatted_Date + ".csv"
$Truncated_Log_Path = $LogPath + "Archive-Security_on_" + $Formatted_Date + ".evtx"
$Today_Midnight = (Get-Date -Hour 0 -Minute 0 -Second 0)
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
@foreach( $trip->photos as $photo )
<li data-target="#carousel-example-generic" data-slide-to="{{ $loop->index }}" class="{{ $loop->first ? 'active' : '' }}"></li>
@endforeach
</ol>
<!-- Wrapper for slides -->
@EdwardNavarro
EdwardNavarro / simple-json-reponse.php
Created July 7, 2019 17:17 — forked from james2doyle/simple-json-reponse.php
A simple JSON response function for PHP. Used in various PhileCMS plugins.
<?php
function json_response($message = null, $code = 200)
{
// clear the old headers
header_remove();
// set the actual code
http_response_code($code);
// set the header to make sure cache is forced
header("Cache-Control: no-transform,public,max-age=300,s-maxage=900");
@EdwardNavarro
EdwardNavarro / nginx.conf
Created July 17, 2020 23:58 — forked from ragingwind/nginx.conf
Redirect old-classic browser including IE 11
worker_processes 1;
events {
worker_connections 1024;
}
http {
map $http_user_agent $outdated {
default 0;
"~MSIE [1-10]\." 1;
<!doctype html>
<html>
<head>
<script>
//This plays a file, and call a callback once it completed (if a callback is set)
function play(audio, callback) {
audio.play();
if (callback) {
@EdwardNavarro
EdwardNavarro / app.js
Created April 3, 2021 05:25 — forked from 11philip22/app.js
Crack Monokai pro theme for Visual Studio Code or VSCodium
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("path"),require("child_process"),require("os"),require("fs")):"function"==typeof define&&define.amd?define(["path","child_process","os","fs"],t):"object"==typeof exports?exports["app"]=t(require("path"),require("child_process"),require("os"),require("fs")):e["app"]=t(e["path"],e["child_process"],e["os"],e["fs"])}(this,function(e,t,s,i){return(e=>{function t(i){if(s[i])return s[i].exports;var r=s[i]={i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var s={};return t.m=e,t.c=s,t.d=((e,s,i)=>{t.o(e,s)||Object.defineProperty(e,s,{configurable:!1,enumerable:!0,get:i})}),t.n=(e=>{var s=e&&e.__esModule?function(){return e["default"]}:function(){return e};return t.d(s,"a",s),s}),t.o=((e,t)=>Object.prototype.hasOwnProperty.call(e,t)),t.p="",t(t.s=1)})([(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={APP:{NAME:"MonokaiPro-VSCode",
THEMES:["Monokai Pro","Monokai Pro (F
@EdwardNavarro
EdwardNavarro / gist:5b6d04aea20bf7bca319075a5182a0f7
Created May 31, 2021 20:36 — forked from dustyf/gist:b6e72a7a7fd05de9598e
Example WordPress Simple JSON Endpoint Plugin
<?php
/**
* Plugin Name: WDS GIF API
* Plugin URI: http://webdevstudios.com
* Description: Adds a Custom Post Type to store GIFs and an API JSON Endpoint to access GIFs by a tag.
* Author: WebDevStudios
* Author URI: http://webdevstudios.com
* Version: 1.0.0
* License: GPLv2
*/
@EdwardNavarro
EdwardNavarro / wp-config.php
Created April 10, 2023 19:32 — forked from MikeNGarrett/wp-config.php
All those damned wp-config constants you can never remember.
<?php
// PHP memory limit for this site
define( 'WP_MEMORY_LIMIT', '128M' );
define( 'WP_MAX_MEMORY_LIMIT', '256M' ); // Increase admin-side memory limit.
// Database
define( 'WP_ALLOW_REPAIR', true ); // Allow WordPress to automatically repair your database.
define( 'DO_NOT_UPGRADE_GLOBAL_TABLES', true ); // Don't make database upgrades on global tables (like users)
// Explicitely setting url