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
@carwin
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() {
$.ajax({
// Your CSS here.
url: 'https://raw.githubusercontent.com/laCour/slack-night-mode/master/css/raw/black.css',
success: function(css) {
$("<style></style>").appendTo('head').html(css);
}
});
});
@carwin
carwin / SassMeister-input-HTML.html
Created Feb 12, 2016
Generated by SassMeister.com.
View SassMeister-input-HTML.html
<div class="container">
<div class="A"><img src="http://placehold.it/1000x500" /></div>
<div class="B">
<div class="C"><img src="http://placehold.it/500x500" /></div>
<div class="D"><img src="http://placehold.it/500x500" /></div>
</div>
@carwin
carwin / UpdateAndroidHosts
Created Dec 1, 2014
Update Android emulator hosts file
View UpdateAndroidHosts
adb pull /system/etc/hosts /tmp/hosts
echo "192.168.57.1 test.example.com" >> /tmp/hosts
adb remount
adb push /tmp/hosts /system/etc
@carwin
carwin / your_module.module
Last active Aug 29, 2015
D7: Using the Picture module in code
View your_module.module
<?php
/**
* 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
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
carwin / SassMeister-input.scss
Created Apr 4, 2014
Generated by SassMeister.com.
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
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).
MINUTES_IN_HOUR = 60
MINUTES_IN_DAY = MINUTES_IN_HOUR * 24
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
end
puts "Give it to me in Fahrenheit:"
temp = gets
puts "Here it is in Celsius: " + convert(temp).to_s
@carwin
carwin / ghfm.rb
Created Mar 27, 2013
GitHub Flavored Markdown Processor
View ghfm.rb
#!/usr/bin/ruby
require 'rubygems'
require 'redcarpet'
require 'albino'
class SyntaxRenderer < Redcarpet::Render::HTML
def block_code(code, language)
if language && !language.empty?
Albino.colorize(code, language)
@carwin
carwin / gist:5148181
Last active Dec 14, 2015
Notes: Drupal 8 Mobile Initiative Meeting 32.0
View gist:5148181

Drupal Mobile Initiative Meeting 32.0

  1. Code Freeze Retrospective due on Thursday * John is doing a screencast * Shyamala's outline is: in this Google Doc * Screenshots are needed

  2. John needs to connect with js folks like _nod * there are still a lot of js related tickets.

You can’t perform that action at this time.