Skip to content

Instantly share code, notes, and snippets.

Carwin Young carwin

Block or report user

Report or block carwin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View dice.go
package dice
import {
func RollDice(count int, sides int) int {
min := 1
max := sides
carwin / ssb-interop.js
Created Aug 30, 2018
Theme Slack Desktop
View ssb-interop.js
// Append to the bottom of /usr/lib/slack/resources/app.asar.unpacked/src/static/ssb-interop.js
document.addEventListener('DOMContentLoaded', function() {
// Your CSS here.
url: '',
success: function(css) {
carwin / SassMeister-input-HTML.html
Created Feb 12, 2016
Generated by
View SassMeister-input-HTML.html
<div class="container">
<div class="A"><img src="" /></div>
<div class="B">
<div class="C"><img src="" /></div>
<div class="D"><img src="" /></div>
carwin / UpdateAndroidHosts
Created Dec 1, 2014
Update Android emulator hosts file
View UpdateAndroidHosts
adb pull /system/etc/hosts /tmp/hosts
echo "" >> /tmp/hosts
adb remount
adb push /tmp/hosts /system/etc
carwin / your_module.module
Last active Aug 29, 2015
D7: Using the Picture module in code
View your_module.module
* Helper function.
* Prepares the necessary array for use with theme_picture.
* @param array $variables
* The image array loaded from field_get_items.
* @param string $group
carwin / element-background.scss
Created May 16, 2014
element background magic
View element-background.scss
@mixin element-background($color, $direction: top) {
@if type-of($color) == list {
background-color: nth($color, 1);
@include background-image(linear-gradient($direction, $color));
else {
@if ($color != 'none') {
$percent: alpha($color) * 100%;
$opaque: opacify($color, 1);
$solid-color: mix($opaque, white, $percent);
carwin / SassMeister-input.scss
Created Apr 4, 2014
Generated by
View SassMeister-input.scss
// ----
// Sass (v3.3.4)
// Compass (v1.0.0.alpha.18)
// ----
@mixin some-color-name($color) {
@if type-of($color) == 'map' {
background-image: linear-gradient(map-get($color, key1), map-get($color, key2));
carwin / leap_year.rb
Last active Dec 20, 2015
Ruby method that tells you how many minutes are in a given year.
View leap_year.rb
# encoding: utf-8
# Write a method leap_year?. It should accept a year value from the user, check
# whether it is a leap year and return true or false.
# Calculate and display the number of minutes in a leap year (2000 and 2004)
# and the minutes in a non-leap year (1900 and 2005).
def leap_year?
puts "Give me a year, I'll tell you if it leaps:"
View ruby_fahrenheit_to_celsius.rb
def convert(temp)
(temp.to_f - 32) * 5/9
puts "Give it to me in Fahrenheit:"
temp = gets
puts "Here it is in Celsius: " + convert(temp).to_s
carwin / ghfm.rb
Created Mar 27, 2013
GitHub Flavored Markdown Processor
View ghfm.rb
require 'rubygems'
require 'redcarpet'
require 'albino'
class SyntaxRenderer < Redcarpet::Render::HTML
def block_code(code, language)
if language && !language.empty?
Albino.colorize(code, language)
You can’t perform that action at this time.