This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark' | |
require 'set' | |
Document = Struct.new(:id,:a,:b,:c) | |
documents_a = [] | |
documents_h = {} | |
documents_s = Set.new | |
1.upto(10_000) do |n| | |
d = Document.new(n) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Description | |
Using the window.setTimeout function will allow you to hide retargeting cookies and execute them after 45 seconds. | |
This helps provide higher quality leads/audience. The example below shows Facebook's pixel tracker. | |
It could be used for other pixel tracking services too. | |
Case Study @ http://imscalable.com/blog/case-study-retargeting-done-wrong/ | |
*/ | |
// Facebook Code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- https://example.com/sitemaps.xml --> | |
<sitemapindex> | |
<sitemap> | |
<loc>https://example.com/sitemaps/category-electronics.xml</loc> | |
</sitemap> | |
<sitemap> | |
<loc>https://example.com/sitemaps/category-home-entertainment.xml</loc> | |
</sitemap> | |
<sitemap> | |
<loc>https://example.com/sitemaps/category-furniture.xml</loc> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
# Adapted from https://gist.github.com/jkubacki/e2dd904bd648b0bd4554 | |
# checks to see if running | |
launchctl list | grep kibana | |
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.kibana.plist | |
launchctl remove homebrew.mxcl.kibana |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
// Notes: Change @yourname to become your Twitter name. | |
tinymce.PluginManager.add('tweet', function(editor, url) { | |
// Adds a menu item to the tools menu | |
editor.addMenuItem('tweet', { | |
text: 'Tweet This', | |
context: 'insert', | |
onclick: function() { | |
editor.windowManager.open({ | |
title: 'Tweet This', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>Merj - JavaScript onClick Link Example</title> | |
<style> | |
.js-link { | |
color: blue; | |
text-decoration: underline; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark' | |
Benchmark.bm(7) do |x| | |
STR = 'l2yanS' | |
REGEX1 = /^(?=.*[a-z])(?=.*[A-Z])[a-zA-Z\d]{6}$/ | |
REGEX2 = /^(?=.*[a-z])(?=.*[A-Z])[0-9a-zA-Z]{6}$/ | |
x.report("Using backslash d:") { 1_000_000.times do | |
STR =~ REGEX1 | |
end } | |
x.report("Using 0-9:") { 1_000_000.times do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div itemscope="" itemtype="http://schema.org/ClaimReview"> | |
An example paragraph reviewing a claim expressed in another document. | |
<dl> | |
<dt>Date published:</dt> | |
<dd itemprop="datePublished">2014-07-23</dd> | |
<dt>Review url:</dt> | |
<dd itemprop="url">http://www.politifact.com/texas/statements/2014/jul/23/rick-perry/rick-perry-claim-about-3000-homicides-illegal-immi/</dd> | |
<dt>Review by:</dt> | |
<dd> | |
<span itemprop="author" itemscope="" itemtype="http://schema.org/Organization"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Network Working Group T. Berners-Lee | |
Request for Comments: 3986 W3C/MIT | |
STD: 66 R. Fielding | |
Updates: 1738 Day Software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'cgi' | |
CGI_METHODS = %w[escape unescape] | |
USAGE = "usage: #{File.basename(__FILE__)} input output type" | |
input = ARGV[0] | |
output = ARGV[1] | |
type = ARGV[2] |
NewerOlder