Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
<script src="http://code.jquery.com/jquery.min.js"></script>
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap-combined.min.css" rel="stylesheet">
<script src="https://raw.github.com/wycats/handlebars.js/1.0.rc.2/dist/handlebars.js"></script>
<script src="https://raw.github.com/emberjs/ember.js/release-builds/ember-1.0.0-pre.4.js"></script>
<script src="https://gist.github.com/raw/4628483/3ad866d0921ac05ecb466513e3048296a07db6ce/ember-11.js"></script>
@blastseld
blastseld / computedChildren.js
Created December 8, 2013 22:19
javascript get computed css style for all children
$(function(){
$('#responsive_links_top').find('*').each(function(){
console.log($(this))
console.log('computed: ',$(this).height())
console.log('height: ',$(this).css('height'))
console.log('min-height: ',$(this).css('min-height'))
console.log('max-height: ',$(this).css('max-height'))
console.log('line-height: ',$(this).css('line-height'))
});
})
@blastseld
blastseld / backend.php
Created December 3, 2013 15:08
Contact email form using swift.
<?php
require_once '../../swift/lib/swift_required.php';
$success = false;
$senderName = isset( $_POST['senderName'] ) ? preg_replace( "/[^\.\-\' a-zA-Z0-9]/", "", $_POST['senderName'] ) : "";
$senderEmail = isset( $_POST['senderEmail'] ) ? preg_replace( "/[^\.\-\_\@a-zA-Z0-9]/", "", $_POST['senderEmail'] ) : "";
$message = isset( $_POST['message'] ) ? preg_replace( "/(From:|To:|BCC:|CC:|Subject:|Content-Type:)/", "", $_POST['message'] ) : "";
@blastseld
blastseld / getParameterByName.coffee
Created October 7, 2013 17:10
Get paramaters get request by name in javascript coffeescript
getParameterByName = (name) ->
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]")
regex = new RegExp("[\\?&]" + name + "=([^&#]*)")
results = regex.exec(location.search)
(if not results? then "" else decodeURIComponent(results[1].replace(/\+/g, " ")))
@blastseld
blastseld / gitpush.sh
Created September 26, 2013 16:47
Git command for check commit and push.
git status
git add *
git status
git commit -m landing
git push -u origin master
html {
position: relative;
min-height: 100%;
}
body {
margin: 0 0 100px; /* bottom = footer height */
}
footer {
position: absolute;
left: 0;
@blastseld
blastseld / responsiveYoutube
Created September 15, 2013 15:14
Responsive Youtube video.
<div class="video-container">
<iframe src="http://www.youtube.com/embed/dFVxGRekRSg" frameborder="0"></iframe>
</div>
@blastseld
blastseld / apache_redirect_domain_tld
Created September 14, 2013 10:51
Apache 301 SEO redirect of domain, subdomain, tld, naked domain.
# Example of working basic configuration
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName www.villapiaeventi.it
DocumentRoot /var/www/villapiaeventi.it
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
@blastseld
blastseld / responsivelikebox
Created September 14, 2013 10:42
Responsive like box for facebook fan page snippets.
#fb-root {
display: none;
}
.fb_iframe_widget, .fb_iframe_widget span, .fb_iframe_widget span iframe[style] {
width: 100% !important;
overflow-x: hidden;
}
div.fb-like-box,