Skip to content

Instantly share code, notes, and snippets.

View bronze's full-sized avatar
😎

Carlos Bronze bronze

😎
View GitHub Profile
Options +FollowSymlinks
RewriteEngine on
# No intersticial for direct reference and self-reference
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://box.leebyron.com/.*$ [NC]
# Add a line item for every website you don't need an intersticial for
# I've added my own website, gmail and facebook
RewriteCond %{HTTP_REFERER} !^http(s)?://([^\.]*.)?leebyron.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://mail.google.com/.*$ [NC]
@sashasklar
sashasklar / maximize.jquery.js
Created February 8, 2011 23:39
jQuery snippet for making an element "full screen" in mobile browsers. Includes hiding the address bar and silencing scroll events in jQuery Mobile.
(function($) {
$.maximize = function() {
var $body = $('body');
// prevent scrollstart and scrollstop events from fireing in jquery mobile
if ($.event.special.scrollstart) {
$.event.special.scrollstart.enabled = false;
}
// expand the body so there's enough room for the address bar to scroll out of view
@ocean90
ocean90 / box-shadow.html
Last active July 12, 2024 04:58
CSS3 Box Shadow, only top/right/bottom/left and all
<!DOCTYPE html>
<html>
<head>
<title>Box Shadow</title>
<style>
.box {
height: 150px;
width: 300px;
margin: 20px;
@thirdender
thirdender / gist:1725514
Created February 2, 2012 20:16
Example fragment loading using pjax: https://github.com/defunkt/jquery-pjax
// Handle previous/next navigation
$(function() {
// Requires jQuery 1.7+ to utilize the new "on" event attachment
$("#contentPadding").on("click", "a.prev, a.next", function (event) {
$.pjax({
"url": $(this).attr("href"),
"fragment": "#contentPadding",
"container": "#contentPadding",
"complete": function(data) {
// Update the className on the BODY tag
@panuta
panuta / gist:1852087
Last active June 16, 2024 18:15
How to setup Django/Postgresql on OS X Mountain Lion using Homebrew

Command Line Tools for Xcode

Command line tools comes bundle with Xcode prior to 4.3 version. After 4.3, you need to install a separated command line tools yourself.

First, go to this url and login using Apple Developer account (Free to register)

https://developer.apple.com/downloads/index.action
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
@dstorey
dstorey / dabblet.css
Created July 3, 2012 06:53
set the size of the boxes and any decoration
.slider {
/* set initial width */
width: 520px;
/* hide the content that overflows (to allow second box to show through) */
overflow: hidden;
display: inline-block;
/* skew container so that it has angled edge, and set up transition */
transform: skewX(-20deg);
@texnixe
texnixe / longpost.php
Last active February 24, 2017 19:07
Template for [Kirby CMS](http://getkirby.com) that splits long post into several pages where the content file has a <!--pagebreak--> tag. Adds pagination ( prev numbers next). Put <!--pagebreak--> tag into your content file where you want to split the post.
<?php
// store the content of the kirbytext text variable in $text
$text = kirbytext($page->text());
// split the content of $text whenever a <!--pagebreak--> code is encountered and store in the array $pages
$pages = explode('<!--pagebreak-->', $text);
// count the number of pages in the array
$pageCount = count ($pages);
@davidjgoss
davidjgoss / gist:9608808
Created March 17, 2014 21:31
Report viewport resizes (where width or height has changed by 50px or more) and orientation changes as "Viewport" events to Google Analytics, in order to find out on average how many resizes are down to orientation changes and how many are actual window resizes.
var viewportclock,
startwidth = document.documentElement.clientWidth,
startheight = document.documentElement.clientHeight,
widthchange,
heightchange;
var testResize = function() {
widthchange = startwidth - document.documentElement.clientWidth;
heightchange = startheight - document.documentElement.clientHeight;
if (widthchange > 50 || widthchange < -50) {
@bastianallgeier
bastianallgeier / statify.php
Last active October 4, 2022 17:12
A first draft for a script, which converts a Kirby site into a static site. It's a rough first draft, so don't expect it to be perfect. Play with it, if you like it!
<?php
/**
* Instructions:
*
* 1. Put this into the document root of your Kirby site
* 2. Make sure to setup the base url for your site correctly
* 3. Run this script with `php statify.php` or open it in your browser
* 4. Upload all files and folders from static to your server
* 5. Test your site