Skip to content

Instantly share code, notes, and snippets.

View thekarel's full-sized avatar

Charles Szilagyi thekarel

View GitHub Profile
@thekarel
thekarel / Stackato.yml
Created September 3, 2013 08:45
mod_proxy and balancer on Stackato
hooks:
pre-running:
- cp /app/apache/mods-available/proxy* /app/apache/mods-enabled/
- cp balancer.conf /app/apache/mods-enabled/
[Tue Sep 03 13:35:58.125158 2013] [rewrite:trace3] [pid 31092:tid 1612] mod_rewrite.c(467): [client 10.242.31.99:56927] 10.242.31.99 - - [10.242.31.99/sid#35df50][rid#276d7d8/initial] [perdir C:/xampp/htdocs/WebSite/v1/folder/home/] strip per-dir prefix: C:/xampp/htdocs/WebSite/v1/folder/home/ ->
[Tue Sep 03 13:35:58.125158 2013] [rewrite:trace3] [pid 31092:tid 1612] mod_rewrite.c(467): [client 10.242.31.99:56927] 10.242.31.99 - - [10.242.31.99/sid#35df50][rid#276d7d8/initial] [perdir C:/xampp/htdocs/WebSite/v1/folder/home/] applying pattern 'WebSite/v1/folder/home/' to uri ''
[Tue Sep 03 13:35:58.125158 2013] [rewrite:trace1] [pid 31092:tid 1612] mod_rewrite.c(467): [client 10.242.31.99:56927] 10.242.31.99 - - [10.242.31.99/sid#35df50][rid#276d7d8/initial] [perdir C:/xampp/htdocs/WebSite/v1/folder/home/] pass through C:/xampp/htdocs/WebSite/v1/folder/home/
::Delete Temporary Internet Files
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8
::Delete Cookies
::RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2
::Delete History
::RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1
::Delete Form Data
var rect = element.getBoundingClientRect();
console.log(rect.top, rect.right, rect.bottom, rect.left);
@thekarel
thekarel / corner.html
Created September 16, 2013 09:13
CSS triangle / corner from @jamtat
data:text/html, <html><head></head><body><div style=" font-size: 50px; border-left: 1em solid red; border-bottom: 1em solid transparent; border-top: 1em solid red; width: 0; "></div> </body></html>
@thekarel
thekarel / Gruntfile.js
Created September 18, 2013 09:39
Grunt template for LESS projects
module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
styles: {
files: ["css/less/*"],
tasks: ["less:development"],
@thekarel
thekarel / Gruntfile.js
Created September 20, 2013 09:29
cssmin Grunt task to compress all non-minified css in a directory
cssmin: {
minify: {
expand: true,
cwd: 'css/lib/',
src: ['*.css', '!*.min.css'],
dest: 'css/lib/',
ext: '.min.css'
}
}
myApp.config(function($routeProvider, $locationProvider) {
$locationProvider.html5Mode(true);
$routeProvider
.when('/page1', { template: 'page1.html', controller: 'Page1Ctrl' })
.when('/page2', { template: 'page2.html', controller: 'Page2Ctrl' })
});
// Get on screen image
var screenImage = $("#image");
// Create new offscreen image to test
var theImage = new Image();
theImage.src = screenImage.attr("src");
// Get accurate measurements from that.
var imageWidth = theImage.width;
var imageHeight = theImage.height;
@thekarel
thekarel / elementhtml.js
Created September 25, 2013 15:53
Get selected elements full HTML (not the inner, .html()) -- From http://stackoverflow.com/questions/2419749/get-selected-elements-outer-html
$('A').each(function(){
var s = $(this).clone().wrap('<p>').parent().html();
console.log(s);
});