Skip to content

Instantly share code, notes, and snippets.

@weivall
weivall / gist:3513624
Created August 29, 2012 14:44
Access-Control-Allow-Origin
<Directory "/home/the directory_where_your_serverside_pages_is">
Header set Access-Control-Allow-Origin "*"
AllowOverride all
Order allow,deny
Allow from all
</Directory>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@weivall
weivall / gist:3675345
Created September 8, 2012 14:19
stargazer init.d for CentOS 6
#!/bin/bash
#
# processname: stargazer
# config: /etc/stargazer/stargazer.conf
# pidfile: /var/run/stargazer.pid
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
@weivall
weivall / gist:3742219
Created September 18, 2012 09:21
meta tags
<meta http-equiv="Imagetoolbar" content="no" />
<meta name="SKYPE_TOOLBAR" content="SKYPE_TOOLBAR_PARSER_COMPATIBLE" />
<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="" />
@weivall
weivall / gist:3814224
Created October 1, 2012 20:28
Facebook share link || Twitter share link
http://www.facebook.com/sharer.php?u=<url to share>&t=<title of content>link or image</a>
<a href="http://www.twitter.com/share?url=http://www.google.com/>Tweet</a>
@weivall
weivall / gist:3877899
Created October 12, 2012 08:03
google map coordinates
gApplication.getMap().getCenter()
@weivall
weivall / gist:3885888
Created October 13, 2012 19:42
on resize timeout
var flag = false;
$(window).resize(function(){
if(flag === false){
setTimeout(function(){
$( '.scroll-pane' ).jScrollPane();
flag = false;
}, 300);
}
flag = true;
});
@weivall
weivall / gist:4146990
Created November 26, 2012 07:15
w00tw00t.at.blackhats.romanian.anti-sec
#http://www.securityweek.com/hacked-mit-server-used-stage-attacks-scan-vulnerabilities
Using mod-rewrite in HTACCESS can filter these scans, redirecting them to your main domain or elsewhere, such as a 403 page.
RewriteCond %{REQUEST_URI} ^(.*)//+(.*)$
RewriteRule / http: //www.example.com/%1/%2 [R=301,L]
@weivall
weivall / load mysql file through php
Created January 18, 2013 14:50
load mysql file through php
<?php
ini_set('memory_limit', '5120M');
set_time_limit ( 0 );
/***************************************************************************
* sql_parse.php
* -------------------
* begin : Thu May 31, 2001
* copyright : (C) 2001 The phpBB Group
* email : support@phpbb.com
@weivall
weivall / index.html
Created February 12, 2013 09:31
A CodePen by Andrey. 3D objects in CSS - This is a demo for my blog post on creating 3D Worlds in HTML and CSS: http://blog.keithclark.co.uk/creating-3d-worlds-with-html-and-css/
<input id="box-toggle" type="checkbox">
<label for="box-toggle">Show geometry</label>