Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View anchetaWern's full-sized avatar
🏠
Working from home

Wern Ancheta anchetaWern

🏠
Working from home
View GitHub Profile
@anchetaWern
anchetaWern / responsive-voice.js
Created May 16, 2015 09:44
responsive-voice.js
//Look for other responsivevoice instances
/*if (window.parent != null) {
var iframes = window.parent.document.getElementsByTagName('iframe');
for (var i = 0; i < iframes.length; i++) {
//iframes[i].style.width = "300px"
}
}*/
if (typeof responsiveVoice != 'undefined') {
console.log('ResponsiveVoice already loaded');

In this article I'm going to walk you through process of creating Wordpress plugins. First I'm going to talk about some of the basic concepts in Wordpress plugin development like the actions, hooks, and API's that makes up Wordpress. Then were going to build a plugin where we apply some of the concepts and best practices in developing Wordpress plugins.

###Prerequisites

In order to fully benefit from this tutorial you should have a basic knowledge on PHP. As Wordpress is running on PHP and most of the code that we will be writing will be on PHP. A little bit of knowledge on HTML, CSS and JavaScript is also helpful but not required for this tutorial.

@anchetaWern
anchetaWern / laravel-ums.markdown
Created December 6, 2012 11:14
Building a User Management System in Laravel

There's no shortage of good resources for learning laravel. So instead of the usual introductory tutorial were just gonna learn Laravel by building a project from scratch and that's gonna be a User Management System.

I don't know if my definition of a User Management System is correct but here's my idea of what's it's capable of doing:

  • Register Roles
  • Register Users
  • Update Users
@anchetaWern
anchetaWern / quiz-maker.md
Last active July 3, 2023 05:31
Quiz Maker

#Quiz Maker

Create a web application that allows a teacher to create a quiz. The quiz can then be taken by students. There are 3 types of users: admin, teacher, student. Of the 3 types, only the student doesn't have an account. The ID number is used to determine the student.

The admin is responsible for:

  • Creating account for teacher
  • Adding students

The teacher is responsible for:

@anchetaWern
anchetaWern / php-webscraping.md
Created August 4, 2013 13:18
web scraping in php

Have you ever wanted to get a specific data from another website but there's no API available for it? That's where Web Scraping comes in, if the data is not made available by the website we can just scrape it from the website itself.

But before we dive in let us first define what web scraping is. According to Wikipedia:

{% blockquote %} Web scraping (web harvesting or web data extraction) is a computer software technique of extracting information from websites. Usually, such software programs simulate human exploration of the World Wide Web by either implementing low-level Hypertext Transfer Protocol (HTTP), or embedding a fully-fledged web browser, such as Internet Explorer or Mozilla Firefox. {% endblockquote %}

@anchetaWern
anchetaWern / forward.md
Created August 9, 2022 09:59 — forked from jamestalmage/forward.md
Using Firebase to Authenticate to Google Drive

Note: There is a lot of information here, but if I have provided a link, it is probably something you should click on and read. OAuth is a complex enough subject on it's own, and hacking these two services together only adds to it.

Even so, I have found Firebase's API to be simpler than almost any other OAuth solution I have explored. When all is said and done, the important bits of code related to authentication is actually less than 10 lines. If you have ever tried to implement your own OAuth flow before, you know how amazing that is.

In the end, it may be worth using Firebase for authentication, even if that's the ONLY thing you use it for.

@anchetaWern
anchetaWern / training phrases of basic_data intent
Created July 12, 2019 05:14
Pokedex Bot: training phrases of basic_data intent
image of pokemon
pokemon image
photo of meowth
what are the abilities of hitmonlee
tell me about pokemon
what's the description of pokemon
what are the moves of pokemon
Things I wish I was told when I first started Web Development
In this post I want to share some of the things I wish someone told me when I first started Web Development.
Things that could have made me a better developer.
Things that could have gotten me into the right path when I first started.
###The learning doesn't stop
There's always a new technology, tools, and methodology
@anchetaWern
anchetaWern / devnews
Created March 30, 2015 00:22
devnews.sql
-- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Mar 28, 2015 at 01:44 AM
-- Server version: 5.5.41-0ubuntu0.14.04.1
-- PHP Version: 5.5.9-1ubuntu4.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
@anchetaWern
anchetaWern / aspect.js
Created July 24, 2019 03:47
get image aspect ratio
function getRandomInt(min, max) {
let sign = Math.random() < 0.5 ? -1 : 1;
min = Math.ceil(min);
max = Math.floor(max);
return (Math.floor(Math.random() * (max - min + 1)) + min) * sign;
}
function getNewHeight(oldWidth, oldHeight, newWidth) {
const aspectRatio = (oldWidth / oldHeight);
const newHeight = (newWidth / aspectRatio);