Skip to content

Instantly share code, notes, and snippets.

@datamosh
datamosh / carousel.js
Created September 27, 2012 12:48
Tiny Carousel
@datamosh
datamosh / fixedscroll.html
Created September 27, 2012 12:24
Fixed scroll
<!doctype html>
<html lang="es">
<head>
<title></title>
<script src="http://code.jquery.com/jquery-1.8.0.min.js"></script>
<meta charset=utf-8/>
</head>
<style type="text/css" media="screen">
.message {
@datamosh
datamosh / facebook.ui.php
Created July 26, 2012 14:24
Educaedu Facebook UI
<?php
require 'facebook.php';
header('P3P:CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"');
class Facebook_UI extends Facebook {
// Get secret app secret
function getSecret() {
return $this->appSecret;
}
@datamosh
datamosh / alea.js
Created June 30, 2012 20:08
Better random generator in javascript
// From http://baagoe.org/en/w/index.php/Better_random_numbers_for_javascript
// Test: http://jsperf.com/prngs/2
function Alea() {
return (function(args) {
// Johannes Baagøe <baagoe@baagoe.com>, 2010
var s0 = 0;
var s1 = 0;
var s2 = 0;
var c = 1;
@datamosh
datamosh / app.js
Created May 15, 2012 15:34
Facebook SDK jQuery
$(function() {
window.fbAsyncInit = function() {
FB.init({
appId: {APPID},
status: true,
cookie: true,
xfbml: true
})
FB.api('/me', function(response) {
@datamosh
datamosh / LICENSE.txt
Created March 23, 2012 21:03 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@datamosh
datamosh / scrollin.js
Created January 26, 2012 15:41
jQuery Scroll fix for messiha
$(document).ready(function () {
$('#timeline').mousedown(function (event) {
// Form fix!
var target = $(event.target); if(target.attr('type') != undefined) target.focus();
$(this)
.data('down', true)
.data('x', event.clientX)
.data('scrollLeft', this.scrollLeft);