Skip to content

Instantly share code, notes, and snippets.

@scalaview
scalaview / gist:9eee2fa53eb506209f92
Created February 25, 2016 08:00 — forked from ibogun/gist:ec0a4005c25df57a1b9d
Installing gcc 4.9 & g++ 4.9 on Ubuntu 12.04 OR Ubuntu 14.04
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-4.9
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 50
sudo apt-get install g++-4.9
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 50
@scalaview
scalaview / install_nvidia_driver_in_ubuntu1604.md
Last active April 24, 2017 05:59 — forked from terrydang/install_nvidia_driver_in_ubuntu1604.md
Ubuntu 16.04 安装英伟达(Nvidia)显卡驱动

Ubuntu 16.04 安装英伟达(Nvidia)显卡驱动

配有英伟达显卡的主机,装完 Ubuntu 16.04 后出现闪屏现象,是由于没有安装显卡驱动。

显卡型号
NVIDIA Corporation GM204 [GeForce GTX 970]

@scalaview
scalaview / rails-aws-ses-ruby-aws-sdk-2.rb
Created May 11, 2017 09:19 — forked from mankind/rails-aws-ses-ruby-aws-sdk-2.rb
Getting started aws ses and demo using aws_sdk gem version 2
Getting started aws ses
http://codechannels.com/video/amazonwebservices/cloud/getting-started-with-amazon-ses/
1. Verify email address
In the sandbox you can send email only from emails yiu have verified.
Go to email AWS SES then on the left clcik on 'verified senders'
to start the verification process:
a. click 'verify a ne sender'
in the dialogue box add your email and click submit. you will receive
@scalaview
scalaview / Casino.sol
Created March 15, 2018 15:18 — forked from anonymous/Casino.sol
Created using browser-solidity: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://ethereum.github.io/browser-solidity/#version=soljson-v0.4.21+commit.dfe3193c.js&optimize=false&gist=
pragma solidity ^0.4.10;
contract Ownable {
address owner;
function Ownable() public {
owner = msg.sender;
}
modifier Owned {
require(msg.sender == owner);
@scalaview
scalaview / shared.rb
Created September 16, 2018 15:13 — forked from pbosetti/shared.rb
IPC shared memory access via FFI
#!/usr/bin/env ruby
# untitled.rb
# Created by Paolo Bosetti on 2011-04-22.
# Copyright (c) 2011 University of Trento. All rights reserved.
require "rubygems"
require 'ffi'
module Shared
@scalaview
scalaview / clear-sidekiq-jobs.sh
Created October 9, 2018 07:23 — forked from wbotelhos/clear-sidekiq-jobs.sh
Clear Sidekiq Jobs
# 1. Clear retry set
Sidekiq::RetrySet.new.clear
# 2. Clear scheduled jobs
Sidekiq::ScheduledSet.new.clear
# 3. Clear 'Processed' and 'Failed' jobs
@scalaview
scalaview / gist:cc271669dd46fc0eecee9fcef101e8a1
Created October 24, 2018 13:52 — 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
@scalaview
scalaview / GitConfigHttpProxy.md
Created October 21, 2020 13:20 — forked from evantoli/GitConfigHttpProxy.md
Configure Git to use a proxy

Configure Git to use a proxy

In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

@scalaview
scalaview / README.md
Created February 2, 2021 08:17 — forked from chuyik/README.md
macOS 给 Git(Github) 设置代理(HTTP/SSH)
@scalaview
scalaview / pipelines.rb
Created February 27, 2021 15:37 — forked from sclinede/pipelines.rb
Sagas implementation in pure Ruby (pre-DirtyPipelines gem)
class DirtyPipeline::Action
module WrappedCall
def call
Events.publish! Event.generate(self)
super
end
end
class << self
attr_accessor :attempted_event_klass, :pipeline, :timeout