Skip to content

Instantly share code, notes, and snippets.

View cbfrance's full-sized avatar
💚

Chris B. France cbfrance

💚
View GitHub Profile
@cbfrance
cbfrance / filter.sh
Last active April 22, 2017 01:05
Truncate a repo at an arbitrary point
git filter-branch --parent-filter '
read parent
if [ "$parent" = "-p <COMMIT ID>" ]
then
echo
else
echo "$parent"
fi'
  • a task list item
  • list syntax required
  • normal formatting, @mentions, #1234 refs
  • incomplete
  • completed
input[type='email'] {
width: 68%;
&:focus {
// outline: 1px dotted;
border-bottom: 1px solid $dodger-blue;
}
// When clicking in this element, light up the button
&:focus ~ input[type='submit'] {
@keyframes gradient {
0%{background-position:0% 0%}
10%{background-position:10% 15%}
20%{background-position:20% 25%}
30%{background-position:30% 35%}
40%{background-position:40% 45%}
50%{background-position:50% 55%}
60%{background-position:60% 65%}
70%{background-position:70% 75%}
80%{background-position:80% 85%}
@cbfrance
cbfrance / texture.html
Created August 25, 2015 06:13
canvas texture
<canvas style="background: red;" width="600px" height="600px"></canvas>
<script>
var cx = document.querySelector("canvas").getContext("2d");
function branch(length, angle, scale) {
cx.fillRect(0, 0, 1, length);
if (length < 10) return;
cx.save();
cx.translate(0, length);
cx.rotate(-angle);
branch(length * scale, angle, scale);
@cbfrance
cbfrance / screenshot.rb
Created July 10, 2015 01:26
screenshotting with our smartshot gem for multilingual QA
require "smartshot"
# see the capybara + poltergeist options listed at:
# https://github.com/teampoltergeist/poltergeist#taking-screenshots-with-some-extensions
fetcher = Smartshot::Screenshot.new(window_size: [1200, 900])
urls = ['meedan.com','meedan.checkdesk.org/en', 'meedan.checkdesk.org/ar']
urls.each do |u|
fetcher.take_screenshot! url: "http://#{u}", output: "./screenshots/#{u}.png", sleep: 10, timeout: 30, full: false
end
@cbfrance
cbfrance / example-responsive.scss
Created February 16, 2015 07:17
Simplest responsive layout with columns()
body.example-responsive-layout {
@include animation("fade-in 2s");
font-family: sans-serif;
// Medium sizes
@media all and (min-width: 800px) {
@include columns(2);
// Use this to break across all of them, like a footer
.footer {
@cbfrance
cbfrance / screen.scss
Last active August 29, 2015 14:15
css animations example
@import "../../compass-mixins/lib/animation/core";
@import "../../compass-mixins/lib/animation/animate/fading";
@import "../../compass-mixins/lib/animation/animate/rotating";
@import "../../compass-mixins/lib/animation/animate/bouncing";
@import "../../compass-mixins/lib/animation/animate/specials";
@import "../../compass-mixins/lib/animation/animate/lightspeed";
@import "../../compass-mixins/lib/animation/animate/attention-seekers";
@import "base";
@import "colors";
@import "definition-lists";
GRAY="\[\033[1;30m\]"
LIGHT_GRAY="\[\033[0;37m\]"
CYAN="\[\033[0;36m\]"
LIGHT_CYAN="\[\033[1;36m\]"
NO_COLOUR="\[\033[0m\]"
def colorprinter(ansi_code, content)
puts ansi_code #Build an ansi code for the terminal
puts content # output the content you want colorized
@cbfrance
cbfrance / Guardfile
Created August 1, 2014 22:29
Guardfile
group :sass, :all_on_start => true do
guard 'livereload', :latency => '0.5', :host => '127.0.0.1', :api_version => '2.0.9', :port => '35729', :apply_css_live => true do
watch(%r{\.(css|php|js)$})
end
guard :compass, configuration_file: './config.rb'
end