Skip to content

Instantly share code, notes, and snippets.

View allcentury's full-sized avatar
🎈

Anthony Ross allcentury

🎈
View GitHub Profile

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.

@allcentury
allcentury / scrabble_score.rb
Created December 16, 2015 15:04
scrabble score
require 'set'
class Scrabble
class Letter
attr_reader :point_value
def initialize(input)
@input = input
@point_value = find_value
end
class SQS
attr_reader :aws, :queue_url
def initialize(aws)
@aws = aws
@queue_url = "https://sqs.us-east-1.amazonaws.com/my-topic-for-sqs"
end
def publish_msg(msg)
aws.send_message(queue_url: queue_url, message_body: JSON.generate(msg))
end
@allcentury
allcentury / The Technical Interview Cheat Sheet.md
Last active August 29, 2015 14:28 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
[1] pry(main)> h = Hash.new({})
=> {}
[2] pry(main)> h[:a]
=> {}
[3] pry(main)> h["a"]
=> {}
[4] pry(main)> h
=> {}
[5] pry(main)> h = Hash.new { |k, v| k[v] = {} }
=> {}
require 'socket'
puts "Using send with a host:"
s = UDPSocket.new
before_time = Time.now
100_000.times do |i|
s.send("#{i}", 0, 'localhost', 1234)
end
puts "Time elapsed was #{Time.now - before_time}"
puts "----------------------------\n\n\n"
package main
import (
"fmt"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
"os"
"github.com/bitly/go-nsq"
"log"
)
set encoding=utf-8
" load up pathogen and all bundles
call pathogen#infect()
call pathogen#helptags()
syntax on " show syntax highlighting
filetype plugin indent on
set autoindent " set auto indent
set ts=2 " set indent to 2 spaces
set encoding=utf-8
" load up pathogen and all bundles
call pathogen#infect()
call pathogen#helptags()
syntax on " show syntax highlighting
filetype plugin indent on
set autoindent " set auto indent
set ts=2 " set indent to 2 spaces

Start weechat if you haven't already:

$ weechat

open up browser and go to: https://irc.gitter.im/ retrieve your /PASS

In weecaht run (thanks to raine):