Skip to content

Instantly share code, notes, and snippets.

@jshawl
jshawl / precess-input-1404995201.scss
Created July 10, 2014 12:26
a precess production
@for $i from 1 through 80{
@media all and ( min-width: #{$i}em ){
body{
@if $i == 1{
height:100%;
border-style:solid;
border-color:hotpink
}
border-width: #{$i}px;
@jshawl
jshawl / precess-input-1404995172.scss
Created July 10, 2014 12:26
a precess production
@for $i from 1 through 3{
@media all and ( min-width: #{$i}em ){
body{
@if $i == 1{
height:100%;
border-style:solid;
border-color:hotpink
}
border-width: #{$i}px;
require 'net/https'
require 'cgi'
require 'uri'
begin
require 'json'
rescue LoadError
require File.join File.dirname(File.dirname(__FILE__)), 'vendor', 'json.rb'
end
@jshawl
jshawl / precess-input-1403722270.scss
Created June 25, 2014 18:51
a precess production
$color: blue;
a{
background:$color;
}
@jshawl
jshawl / wget.rb
Last active August 29, 2015 14:02
require 'open-uri'
require 'nokogiri'
link = "http://entrenchant.blogspot.ch/2012/02/web-page-mirroring-wget-in-ruby.html?m=1"
now = Time.now.to_i.to_s
@doc = Nokogiri::HTML(open( link ))
@css_tags = @doc.css('[rel="stylesheet"]').map { |l| URI.join( link, l['href'] ).to_s }
#!/usr/bin/env ruby
# faux-wget.rb : example of performing wget-style mirroring
require 'nokogiri'
require 'net/http'
require 'fileutils'
require 'uri'
=begin rdoc
Wrap a URI and provide methods for download, parsing, and mirroring of remote HTML document.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>CodePen - A Pen by tkazi</title>
<link rel="stylesheet" href="style.css" media="screen" type="text/css" />
</head>
<body>
<div class="ordered">
<h3>ordered</h3>
require 'pp'
require 'ostruct'
require 'yaml'
require 'jekyll'
require 'date'
require 'digest/md5'
require 'action_view'
require 'rexml/document'
require 'uri'
(1..100).each do |i|
line = i % 3 == 0 ? 'fizz ' : ''
line += i % 5 == 0 ? 'buzz' : ''
line.empty? ? puts(i) : puts(line)
end
html, body{
height:100%;
background:#222;
}
body{
display:flex;
align-items:center;
justify-content:center;
}