This file contains 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
validate :check_dimensions | |
def check_dimensions | |
temp_file = background_image.queued_for_write[:original] | |
unless temp_file.nil? | |
dimensions = Paperclip::Geometry.from_file(temp_file) | |
width = dimensions.width | |
height = dimensions.height | |
if width < 800 && height < 600 |
This file contains 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
<!-- | |
This is the HTML portion of the infinite scroll/pagination with Rails and AngularJS tutorial | |
Required libraries for the tutorial and indicated as "Important", | |
together with implementation specific libraries marked as "Optional" | |
--> | |
<!DOCTYPE html> | |
<html> | |
<title>Clips</title> | |
<!-- Important --> |
This file contains 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
'.text.html.twig': | |
'Verbatim': | |
'prefix': 'verbatim' | |
'body': '{% verbatim %}$1{% endverbatim %}$2' |
This file contains 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
<html> | |
<head> | |
<title>Get Gamepads</title> | |
</head> | |
<body> | |
<!-- adapted from http://stackoverflow.com/questions/10839310/html5-gamepad-api-on-chrome --> | |
<script> | |
function updateStatus() { | |
window.webkitRequestAnimationFrame(updateStatus); |
This file contains 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
<!DOCTYPE html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="author" content="Victor Stan"> | |
<meta name="description" content="Get multiple video streams on one page. Adapted from code by Muaz Khan"> | |
<title>Video Camera</title> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js" ></script> |
This file contains 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
require 'digest/md5' | |
module ProfilePhoto | |
def profile_photo(profile) | |
profile.avatar.url(:thumb).present? ? profile.avatar.url(:thumb) : "http://www.gravatar.com/avatar/#{Digest::MD5.hexdigest(profile.owner.email)}?d=mm" | |
end | |
end | |
# in your application_helper use: | |
# module ApplicationHelper |
This file contains 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
| myHost myPath | | |
"setup" | |
myHost := 'rmod.lille.inria.fr'. | |
myPath := '/pbe2'. | |
ZnClient new | |
systemPolicy; | |
accept: ZnMimeType textHtml; | |
http; |
This file contains 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
.pagination { | |
display:inline-block; | |
form { | |
display: inline-block; | |
margin:0; | |
select { | |
width:100px; | |
} | |
} | |
} |
This file contains 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
var DOMAIN = 'http://localhost' | |
var PORT = 3000; | |
var DATA_SOURCE = '/clips.json'; | |
// ANGULAR | |
function clips_controller($scope, $http) { | |
$scope.clips = []; | |
// get the data from the API backend | |
$http.get(DOMAIN+":"+PORT+DATA_SOURCE).success(function(data) { |
This file contains 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
var html5rocks = {}; | |
var indexedDB = window.indexedDB || window.webkitIndexedDB || | |
window.mozIndexedDB; | |
if ('webkitIndexedDB' in window) { | |
window.IDBTransaction = window.webkitIDBTransaction; | |
window.IDBKeyRange = window.webkitIDBKeyRange; | |
} | |
html5rocks.indexedDB = {}; |