Skip to content

Instantly share code, notes, and snippets.

View vahe's full-sized avatar

Vahe Khachikyan vahe

  • Shopify
  • Toronto, Canada
View GitHub Profile
@Overbryd
Overbryd / 1_example.rb
Last active June 2, 2022 10:27
Sexiest assertion since I started testing APIs: assert_structure
# lets say this is the response we receive
response = {
"results" => {
"total_count" => 15,
"per_page" => 100,
"companies" => [
{
"company" => {
"name" => "Foo Bar Ltd",
"registered_address" => { ... },
@hrldcpr
hrldcpr / tree.md
Last active December 16, 2025 11:48
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

@kylebarrow
kylebarrow / example.html
Created June 23, 2011 06:30
Prevent links in standalone web apps opening Mobile Safari
<!DOCTYPE html>
<head>
<title>Stay Standalone</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<script src="stay_standalone.js" type="text/javascript"></script>
</head>
<body>
<ul>
<li><a href="http://google.com/">Remote Link (Google)</a></li>