Skip to content

Instantly share code, notes, and snippets.

View rohanthewiz's full-sized avatar

Rohan Allison rohanthewiz

  • Texas
View GitHub Profile
@rohanthewiz
rohanthewiz / SassMeister-input.scss
Last active February 15, 2016 20:48
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
// Blend colors with alpha channel to solid color
@function rgba_blend($fore, $back) {
$ored: ((1 - alpha($fore)) * red($back) ) + (alpha($fore) * red($fore));
$ogreen: ((1 - alpha($fore)) * green($back) ) + (alpha($fore) * green($fore));
$oblue: ((1 - alpha($fore)) * blue($back) ) + (alpha($fore) * blue($fore));
@return rgb($ored, $ogreen, $oblue);
@rohanthewiz
rohanthewiz / SassMeister-input.scss
Created February 15, 2016 20:41
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
$acolor: rgba(#040708, 0.76);
@function rgba_blend($fore, $back) {
$ored: ((1 - alpha($fore)) * red($back) ) + (alpha($fore) * red($fore));
$ogreen: ((1 - alpha($fore)) * green($back) ) + (alpha($fore) * green($fore));
$oblue: ((1 - alpha($fore)) * blue($back) ) + (alpha($fore) * blue($fore));
@rohanthewiz
rohanthewiz / go_templates.go
Created January 17, 2016 08:29
Exercising Go templates
package main
import (
"fmt"
"html/template"
"os"
"strings"
)
type Person struct {
Name string
@rohanthewiz
rohanthewiz / SassMeister-input.scss
Created December 18, 2015 04:45
Generated by SassMeister.com.
// ----
// libsass (v3.3.2)
// ----
.asset-edit-table {
width: 100%;
&__row {
width: 100%;
}
&__left-side {
@rohanthewiz
rohanthewiz / channels_and_waitgroups.go
Created December 10, 2015 07:14
Using channels and waitgroups for effective communication with goroutines
package main
import (
"fmt"
"sync"
)
// Send words onto a channel until we receive on the done channel
func emit(wch chan string, dch chan struct{}, wg *sync.WaitGroup) {
words := []string{"The", "quick", "brown", "fox"}
@rohanthewiz
rohanthewiz / EastOrientedwithMethodChaining.rb
Created December 23, 2014 18:02
Example of East Oriented programming via Method Chaining
class Car
def initialize(color, make, model)
@color, @make, @model = color, make, model
# new implicitly returns self
end
def color; puts @color; self; end
def make; puts @make; self; end