Skip to content

Instantly share code, notes, and snippets.

@bogdanRada
bogdanRada / install_intelr_graphic_linux_firmware.sh
Created September 1, 2017 12:49 — forked from zas/install_intelr_graphic_linux_firmware.sh
Fix "W: Possible missing firmware /lib/firmware/i915/kbl_dmc_ver1.bin for module i915_bpo" (Ubuntu 16.04, kernel 4.4)
#!/bin/bash
cd
wget https://01.org/sites/default/files/downloads/intelr-graphics-linux/sklgucver61.tar.bz2 && \
tar xvjf sklgucver61.tar.bz2 && cd skl_guc_ver6_1/ && sudo ./install.sh
cd
wget https://01.org/sites/default/files/downloads/intelr-graphics-linux/kbldmcver101.tar.bz2 && \
@bogdanRada
bogdanRada / gist:28cc6a73240dd3d7d0839c3d0b885cab
Created August 29, 2017 08:18 — forked from ryanlecompte/gist:1283413
Providing an ActiveRecord-like before_filter capability to arbitrary Ruby classes
# First the end result of what we want:
class Foo
before_hook :whoa
before_hook :amazing
def test
puts "This is kinda cool!"
end
@bogdanRada
bogdanRada / MIT License
Created August 17, 2017 08:15 — forked from jcf/MIT License
RSpec matcher for parsing `response.headers['Content-Type']`
Copyright (c) 2012 James Conroy-Finn
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE US
begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
end
gemfile(true) do
source "https://rubygems.org"
@bogdanRada
bogdanRada / sum_exists.rb
Created July 20, 2017 18:08 — forked from kfox/sum_exists.rb
Find all number pairs in a Ruby array that add up to a given number
#!/usr/bin/env ruby
numbers = [2, 6, 4, 8, 8, 9]
sum = ARGV.empty? ? 10 : ARGV.first.to_i
def sum_exists(numbers, sum)
Array(numbers).combination(2).find_all { |x, y| x + y == sum } || []
end
result = sum_exists(numbers, sum)
@bogdanRada
bogdanRada / webex-ubuntu.md
Created July 20, 2017 08:21 — forked from mshkrebtan/webex-ubuntu.md
Run Cisco Webex on 64-bit Ubuntu 16.04

Run Cisco Webex on 64-bit Ubuntu 16.04

With Audio and Screen Sharing Enabled

Enable support for 32-bit executables

Add the i386 architecture to the list of dpkg architectures :

sudo dpkg --add-architecture i386
var page = new WebPage();
page.open('http://espn.go.com/nfl/', function (status) {
//once page loaded, include jQuery from cdn
page.includeJs("http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js", function() {
//once jQuery loaded, run some code
//inserts our custom text into the page
page.evaluate(function(){$("h2").html('Many NFL Players Scared that Chad Moon Will Enter League');});
//take screenshot and exit
page.render('espn.png');
//create new webpage object
var page = new WebPage();
//load the page
page.open('http://espn.go.com/nfl', function (status) {
//fire callback to take screenshot after load complete
page.render('espn.png');
//finish
phantom.exit();
});
@bogdanRada
bogdanRada / compile.sh
Created July 6, 2017 07:05 — forked from moondev/compile.sh
dynamic-screenshots-on-the-server-with-phantomjs - compile.sh
cd ~/
git clone git://github.com/ariya/phantomjs.git && cd phantomjs
qmake-qt4 && make
sudo cp bin/phantomjs /usr/local/bin/
@bogdanRada
bogdanRada / browserstuff.sh
Last active July 6, 2017 07:05 — forked from moondev/browserstuff.sh
dynamic-screenshots-on-the-server-with-phantomjs - browserstuff
sudo apt-get install flashplugin-nonfree msttcorefonts