Skip to content

Instantly share code, notes, and snippets.

View ogorzalka's full-sized avatar

Olivier Gorzalka ogorzalka

View GitHub Profile
// Attempt to make a drop-and-forget bunch of scripts that mimick some missing html5 goodies automatically
// Example:
// $(document).ready(function() {
// ProvideHtml5.autofocus()
// ProvideHtml5.datepicker()
// ProvideHtml5.forcenumber()
// })
//
// Now a real git project, over here: http://github.com/sunny/provide-html5
Font stacks based on system fonts
---------------------------------
Times New Roman stack
font-family: Cambria, "Hoefler Text", Utopia, "Liberation Serif", "Nimbus Roman No9 L Regular", Times, "Times New Roman", serif;
Georgia stack:
font-family: Constantia, "Lucida Bright", Lucidabright, "Lucida Serif", Lucida, "DejaVu Serif," "Bitstream Vera Serif", "Liberation Serif", Georgia, Palatino, Palatino Linotype, Times, Times New Roman, serif;
Garamond stack
#####
##### Easily enable clearType on windows.
#####
*** WHAT IT DOES ***
It asks the user to install an activex control, signed by microsoft.
This activex control allows cleartype options to be set using javascript.
;(function($) {
// Slideshow
$.fn.slideshow = function(options) {
var opts = $.extend({}, {
delay:1000,
interval:5000,
panels:'li'
}, options);
return this.each(function() {
@ogorzalka
ogorzalka / max-dimensions for IE6
Created November 10, 2010 11:05
it's a fucking hack but it can be useful
// maxheight + maxwidth
img {
/* For good browsers :) */
max-height: 510px;
max-width: 510px;
/* Feed the devil :) */
width: expression(this.offsetWidth>=this.offsetHeight?Math.min(500, this.offsetWidth) : 'auto');
height: expression(this.offsetHeight>this.offsetWidth?Math.min(500, this.offsetHeight) : 'auto');
}
@ogorzalka
ogorzalka / jQuery.expand_select.js
Created December 21, 2010 16:24
IE Select Element Fix, jQuery
/*
How to use ?
Easy ! just apply the method to your forms :
$('form').expand_select();
*/
$.fn.expand_select = function () {
if (!$.browser.msie) return;
var s = $(this),
expand = function()
@ogorzalka
ogorzalka / rotate.less
Created May 2, 2011 12:46
Cross Browser rotation with lessjs
.rotate(@deg: 0){
@degree: @deg;
@rotation: `parseInt(this.degree.toJS())`;
@degToRadian: `Math.PI * 2 / 360`;
@rad: `this.rotation.toJS() * this.degToRadian.toJS()`;
@M11: `Math.cos(this.rad.toJS())`;
@M21: `Math.sin(this.rad.toJS())`;
// the properties
-moz-transform: rotate(@deg);
@ogorzalka
ogorzalka / css-responsive-images-alt.html
Created May 19, 2011 07:23 — forked from anthonyshort/css-responsive-images-alt.html
Idea for CSS-only responsive images using CSS3 generated content and attr() function. No browser implementation as of May 2011
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS responsive images</title>
<style>
/* Play nice with existing requirements for
Responsive Images polyfill */
/* Doesn't stop original source image being
@ogorzalka
ogorzalka / .htaccess
Created October 12, 2011 09:26
Node files are redirected to the right node app port
# This is the .htaccess file in our document root.
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{SERVER_PORT} !^3000$ # edit the 3000 port with your node app port
RewriteCond %{REQUEST_URI} .*\.(styl|coffee|less) # stylus, coffeescript and less files are managed
RewriteRule (.*) http://%{HTTP_HOST}:3000%{REQUEST_URI} [P] # edit the 3000 port with your node app port
</IfModule>
@ogorzalka
ogorzalka / project.sh
Created November 17, 2011 13:52
Project management
#!/bin/bash
REMOTESERVER="your_server" # adresse du dépôt distant
REMOTESERVER_USER="ssh_user" # identifiant du serveur distant
REMOTE_GITFOLDER="/chemin/vers/depot/nu/" # chemin du dépôt nu sur le serveur distant
ACTION=$1
REMOTE_GITREPO="$REMOTE_GITFOLDER$PROJECTNAME.git"
LOCALPATH=`pwd`
PROJECTNAME=${PWD##*/}