This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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:" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// 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)); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); | |
} | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dice | |
import { | |
"time" | |
"math/rand" | |
) | |
func RollDice(count int, sides int) int { | |
min := 1 | |
max := sides |