Skip to content

Instantly share code, notes, and snippets.

View TikiTDO's full-sized avatar

TikiTDO TikiTDO

  • Toronto, Canada
View GitHub Profile
@TikiTDO
TikiTDO / filter profile.php
Last active August 29, 2015 13:57
WordPress apply_filter profile
<?php
do {
_logt("Start Filter Tag: $tag");
_logup();
$t_count = 1;
foreach ( (array) current($wp_filter[$tag]) as $the_ ) {
//$func = $the_['function'];
//if (is_string($func)) _log(" " . $func);
//else _log(' *** ' . get_class($func[0]) . ' ' . $func[1]);
}
@TikiTDO
TikiTDO / action profile.php
Last active August 29, 2015 13:56
WordPress do_actions profile
<?php
do {
_logt("Start Action Tag: $tag");
_logup();
$t_count = 1;
foreach ( (array) current($wp_filter[$tag]) as $the_ ) {
//$func = $the_['function'];
//if (is_string($func)) _log(" " . $func);
//else _log(' *** ' . get_class($func[0]) . ' ' . $func[1]);
}
require 'pry'
File.open("out") do |file|
cur_file = nil
diff_files = []
only_files = []
bleh = []
file.each_line do |line|
wtf = nil
begin
state = :init
n = 0
STDIN.each_line do |line|
n += 1
if state == :init
if line =~ /Creating default object from empty value/
state = :stack
next
end
elsif state == :stack
@TikiTDO
TikiTDO / dust_slim.rb
Last active December 22, 2015 23:48
Dust + Slim multi builder Watches a directory in a sleep loop, and executes build chains based on file extensions. Currently supports dust and slim
#!/usr/bin/env ruby
require 'rubygems'
require 'slim'
require 'slim/command'
require 'pry'
def dust(tag, tag_end = nil)
ret = "{##{tag}}"
ret += yield
require 'httpclient'
cln = HTTPClient.new
cln.get_content('http://ipv4.download.thinkbroadband.com/5MB.zip') do |s|
puts 1
end
=begin
# Staging Module
Allows for the configuration of execution stages, and provides code to be executed in
that stage. Node, code is executed in the current context.
This is particularly useful for tasks that need to be performed at specific spots in
the loading process. May also be useful for cleanup code.
## Usage
binding.stage :name do

System Management

These services are used to control network resources

Security

IAM - Manages multiple users across one AWS account

Enterprise Services

Direct Connect – Connects AWS to Data Centers

Storage Gateway - Provides direct access to storage systems

@TikiTDO
TikiTDO / compiler.rb
Last active December 19, 2015 04:29
short example of abstract compilation performed on JS
Lex Config for C - http://www.quut.com/c/ANSI-C-grammar-l.html
Bison Config for C - http://www.quut.com/c/ANSI-C-grammar-y.html
ECMA Spec - http://www.ecma-international.org/ecma-262/5.1/#contents
# Organization
# Statements (Executes an operation)
# Expressions (Evaluates to a value)
js = <<js
function hello() {
# Extracts the SourceElementsNode within the function bodyof the
def extract_context()
@parser.extract({
get: :value,
type: Array,
call: {
get: :first,
type: ExpressionStatementNode,
call: {
get: :value,