Skip to content

Instantly share code, notes, and snippets.

@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!");
}
};
}
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
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)
<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) {
@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);
.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 {
(function(i) {
'use strict';
console.log(i); // undefined
console.log(bar); // function
console.log(animals); // undefined
console.log('-------------------------');
var i = 2;
<area title=" Outgoings">
<feature type="Lease">
<heading>Lease</heading>
<description>94 years remaining</description>
</feature>
<feature type="Ground Rent/Maintenance">
<heading>Ground Rent/Maintenance</heading>
<description>£721.30 per annum.</description>
</feature>
<feature type="NB">
@mixin background-image-retina($file, $type, $width, $height) {
background-image: url($file + '.' + $type);
@media (-webkit-min-device-pixel-ratio: 2), (-moz-min-device-pixel-ratio: 2) {
& {
background-image: url($file + '@2x.' + $type);
-webkit-background-size: $width $height;
}
}
}
def next
project.images.first(:conditions => ["position > ?", position], :order => "position asc")
end
def prev
project.images.last(:conditions => ["position < ?", position], :order => "position desc")
end