Skip to content

Instantly share code, notes, and snippets.

.logo {
background-url('logo.png');
}
@media (-webkit-min-device-pixel-ratio: 1.5),
(min--moz-device-pixel-ratio: 1.5),
(-o-min-device-pixel-ratio: 3/2),
(min-device-pixel-ratio: 1.5),
(min-resolution: 1.5dppx) {
.logo {
@mixin at2x($image_name, $width, $height, $extention: '.png') {
background-image: image_url($image_name + $extention);
$x2img : $image_name + '@2x' + $extention;
@media (-webkit-min-device-pixel-ratio: 1.5),
(min--moz-device-pixel-ratio: 1.5),
(-o-min-device-pixel-ratio: 3/2),
(min-device-pixel-ratio: 1.5),
(min-resolution: 1.5dppx) {
background-image: image_url($x2img);
<img src="logo.svg" width="200" height="300">
<img src="logo.svg" data-png-fallback="logo.png"
width="200" height="300">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script>
<script>
$(function(){
if(!Modernizr.svg) {
post '/create/subscription' do
url_params = {
:amount => 99,
:interval_unit => 'month',
:interval_length => 1,
:name => 'Example Subscription',
:description => 'Regular monthly payments (e.g., for hosting services)',
}
url = GoCardless.new_subscription_url(url_params)
class MenusController < InheritedResources::Base
http_basic_authenticate_with name: "duh", password: "secret"
def new
@menu = Menu.new
@menuitems = Menuitem.all
@menuTags = []
@menuitems.each do |item|
@menuTags << item.description
@almonk
almonk / con.js
Last active August 29, 2015 14:12
function car() {
return {
start: function() {
console.log("Engine on.");
},
accelerate: function() {
console.log("Let's go!");
}
};
}
@almonk
almonk / menu.rb
Last active August 29, 2015 14:27
class Menu < Page
def entry?
true
end
def template
"menu_set/views/show"
end
$ npm -g install localtunnel
/usr/local/bin/lt -> /usr/local/lib/node_modules/localtunnel/bin/client
localtunnel@1.7.0 /usr/local/lib/node_modules/localtunnel
├── debug@0.7.4
├── openurl@1.1.0
├── request@2.11.4
└── yargs@3.15.0 (camelcase@1.2.1, decamelize@1.1.0, window-size@0.1.2, cliui@2.1.0)
$ lt --port 8080
your url is: https://htkzpnysxf.localtunnel.me
@almonk
almonk / gist:83e9cb63a2ab3276f8a5dd79dbc7c016
Created July 3, 2016 09:11
Deploy Craft CMS to Digital Ocean
# Rename craft public/ to html/
# Add new db file locally
return array(
'*' => array(
'server' => 'localhost',
'database' => 'crafttest',
'tablePrefix' => 'craft'
),