Skip to content

Instantly share code, notes, and snippets.

View exocode's full-sized avatar
🏠
Working from home

Jan exocode

🏠
Working from home
View GitHub Profile
@mixin sprite-background($name, $folder) {
$sprites: sprite-map("#{$folder}/*.png");
$sprites-retina: sprite-map("#{$folder}@2x/*.png");
background-image: sprite-url($sprites);
background-position: sprite-position($sprites, $name);
background-repeat: no-repeat;
@include inline-block;
height: image-height(sprite-file($sprites, $name));
width: image-width(sprite-file($sprites, $name));
@exocode
exocode / vendor-ffmpeg-x264-mp3lame-heroku
Last active December 19, 2015 19:58 — forked from czivko/vendor-ffmpeg-x264-mp3lame-heroku
more precise documentation added libavfilter for amerge, amix and co...
## Get FFMpeg working on heroku by building binaries using vulcan
# also added instructions on how to compile with libmp3lame and libx264
####################################
# INSTALL VULCAN if not done already
gem install vulcan
#################
# CREATE YOUR APP "Foo"
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@exocode
exocode / capybara cheat sheet
Last active December 27, 2015 06:49 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@exocode
exocode / selenium-webdriver-cheatsheet.md
Last active December 28, 2015 02:49 — forked from huangzhichong/selenium-webdriver-cheatsheet.md
selenium-webdriver-cheatsheet

API workthough

  1. Open a browser

    # start an instance of firefox with selenium-webdriver
    driver = Selenium::WebDriver.for :firefox
    # :chrome -> chrome
    # :ie     -> iexplore
    
  • Go to a specified URL
# config/locales/en.yml
en:
exception:
show:
not_found:
title: "Not Found"
description: "The page you were looking for does not exists."
internal_server_error:
title: "Internal Server Error"

All of the categories!

I wrote a really simple JavaScript script that uses jQuery to extract all the categories from Facebook's "Create a page" page.

Instructions

  1. Navigate to the Create a page page.
  2. jQuerify the page.
  3. Open up your JavaScript console of choice and run the following script:
@exocode
exocode / geo.rb
Created March 4, 2014 14:55 — forked from gilles/geo.rb
# geo.rb
# Formulas from
#
# haversine formula to compute the great circle distance between two points given their latitude and longitudes
#
# Copyright (C) 2008, 360VL, Inc
# Copyright (C) 2008, Landon Cox
#
# http://www.esawdust.com (Landon Cox)
# adapted from bin/sidekiq
# to invoke, run: zeus runner sidekiq.rb
require 'sidekiq/cli'
begin
cli = Sidekiq::CLI.instance
cli.parse
cli.run
rescue => e
require 'zeus/rails'
class CustomPlan < Zeus::Rails
def sidekiq
# Based on bin/sidekiq
require 'sidekiq/cli'
begin
cli = Sidekiq::CLI.instance
cli.parse