Skip to content

Instantly share code, notes, and snippets.

Avatar

Edward Navarro EdwardNavarro

View GitHub Profile
@EdwardNavarro
EdwardNavarro / gist:5b6d04aea20bf7bca319075a5182a0f7
Created May 31, 2021 — forked from dustyf/gist:b6e72a7a7fd05de9598e
Example WordPress Simple JSON Endpoint Plugin
View gist:5b6d04aea20bf7bca319075a5182a0f7
<?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 / app.js
Created Apr 3, 2021 — forked from 11philip22/app.js
Crack Monokai pro theme for Visual Studio Code or VSCodium
View app.js
!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
View html5 audio queue
<!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 / nginx.conf
Created Jul 17, 2020 — forked from ragingwind/nginx.conf
Redirect old-classic browser including IE 11
View nginx.conf
worker_processes 1;
events {
worker_connections 1024;
}
http {
map $http_user_agent $outdated {
default 0;
"~MSIE [1-10]\." 1;
@EdwardNavarro
EdwardNavarro / simple-json-reponse.php
Created Jul 7, 2019 — forked from james2doyle/simple-json-reponse.php
A simple JSON response function for PHP. Used in various PhileCMS plugins.
View simple-json-reponse.php
<?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");
View gist:331efc7227d396f1c239589b46a446e2
<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 -->
View Audit changed or deleted files in Windows Server 2008 R2 or newer.ps1
# 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)
@EdwardNavarro
EdwardNavarro / gist:16327a0117b85ac10c6c421cd217d7a7
Created May 18, 2019 — forked from johnmorris/gist:8135167
A simple database class using mysqli prepared statements in PHP.
View gist:16327a0117b85ac10c6c421cd217d7a7
<?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() {
@EdwardNavarro
EdwardNavarro / ascii_arty.py
Created May 14, 2019 — forked from jdiaz5513/ascii_arty.py
Console ASCII Art Generator
View ascii_arty.py
#! /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 / TrmSoapClient.py
Created Mar 27, 2019 — forked from cdiaz/TrmSoapClient.py
Obtener La tasa de cambio representativa del mercado (TRM) para Colombia consumiendo el webservice de la Superintentencia Financiera desde Python
View TrmSoapClient.py
#!/usr/bin/env python
from suds.client import Client
import time
WSDL_URL = 'https://www.superfinanciera.gov.co/SuperfinancieraWebServiceTRM/TCRMServicesWebService/TCRMServicesWebService?WSDL'
date = time.strftime('%Y-%m-%d')
def trm(date):
try:
client = Client(WSDL_URL, location=WSDL_URL, faults=True)