Skip to content

Instantly share code, notes, and snippets.

@dusk0r
dusk0r / get_warnings.rb
Created April 21, 2017 11:38
RavenDB Auth in Ruby
require 'restclient'
require 'digest/sha1'
require 'base64'
require 'securerandom'
require 'json'
class RavenCheck
@server_url
@api_key_name
@api_key_secret
@dusk0r
dusk0r / digitec-price.rb
Created March 29, 2017 13:24
Digitec.ch Preis für Produkt
require 'RestClient'
require 'nokogiri'
def getPrice(productId)
res = RestClient.get "https://www.digitec.ch/de/s1/product/#{productId}"
doc = Nokogiri::HTML(res.to_s)
doc.css("#product_reviewed > article .product-price").first.xpath('text()').text.strip.gsub("\u2013", "0").to_f
end
productId = '5721031'
@dusk0r
dusk0r / gist:3d5b46b3ed43aae88b2d
Last active September 3, 2020 16:55
Changing Background Images using jQuery
<html>
<head>
<style type="text/css">
.bgimage {
position: fixed;
background-repeat: no-repeat;
background-position: center;
background-size: cover;
background-color: black;
width: 100%;