Skip to content

Instantly share code, notes, and snippets.

View loo2k's full-sized avatar
🙈
Working from Office

Luke loo2k

🙈
Working from Office
View GitHub Profile
@davidtheclark
davidtheclark / isElementInViewport.js
Created May 4, 2013 02:00
JavaScript: Is element in viewport?
/*
No jQuery necessary.
Thanks to Dan's StackOverflow answer for this:
http://stackoverflow.com/questions/123999/how-to-tell-if-a-dom-element-is-visible-in-the-current-viewport
*/
function isElementInViewport(el) {
var rect = el.getBoundingClientRect();
return (
rect.top >= 0 &&
/*
* Javascript EXIF Reader 0.1.4
* Copyright (c) 2008 Jacob Seidelin, [email protected], http://blog.nihilogic.dk/
* Licensed under the MPL License [http://www.nihilogic.dk/licenses/mpl-license.txt]
*/
var EXIF = {};
(function() {
@Chairo
Chairo / backup.sh
Created March 30, 2012 09:27
自动备份脚本
#!/bin/bash
#Funciont: Backup website and mysql database
#Author: licess
#Website: http://lnmp.org
#IMPORTANT!!!Please Setting the following Values!
bak_dir=/home/backup
if [ -d $bak_dir ]; then
echo 'begin'
@michiel
michiel / cors-nginx.conf
Created July 5, 2011 10:41
Wide-open CORS config for nginx
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#