Skip to content

Instantly share code, notes, and snippets.

View neko-fire's full-sized avatar
💭
Save the princess

Martin neko-fire

💭
Save the princess
  • Germany / Philippines
View GitHub Profile
@neko-fire
neko-fire / gist:2583925
Created May 3, 2012 07:10
C: Skeleton template
#include <stdio.h>
int main()
{
}
@neko-fire
neko-fire / gist:2583930
Created May 3, 2012 07:10
JavaScript: jQuery: doc ready short form
$(function(){
// type jquery code here
});
@neko-fire
neko-fire / gist:2583933
Created May 3, 2012 07:11
JavaScript: skeleton anonymous function
(function(){
// write js here
})();
@neko-fire
neko-fire / gist:2583942
Created May 3, 2012 07:12
HTML5: Skeleton template
<!doctype html>
<!--[if IE 7]><html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]><html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
@neko-fire
neko-fire / gist:2584764
Created May 3, 2012 09:45
JavaScript: format number with leading zero
function formatNumber(number) {
return (number < 10 ? '0' : '') + number;
}
@neko-fire
neko-fire / gist:2651725
Created May 10, 2012 07:40
JavaScript: universal console.log func
var log = function(str) {
if (typeof console != 'undefined' && console != null) console.log(str);
}
@neko-fire
neko-fire / gist:2651741
Created May 10, 2012 07:42
Typo3: UTF-8 repair
1. mysqldump -u root -p mydatabase > dump.sql
2. cp dump.sql dump.sql.bak
3. vi dump.sql
4. :1,$:s/ DEFAULT CHARSET=latin1/ DEFAULT CHARSET=utf8/g
5. :wq
6. mysql -u root -e "DROP DATABASE mydatabase"
7. mysql -u root -e "CREATE DATABASE mydatabase CHARACTER SET utf8"
8. mysql -u root -p mydatabase < dump.sql
## In TYPO3 installTool:
@neko-fire
neko-fire / gist:2651746
Created May 10, 2012 07:43
TypoScript: Bodyclass with pageID
page.bodyTag >
page.bodyTagCObject = TEXT
page.bodyTagCObject {
field = uid
wrap = <body class="uid-|">
}
@neko-fire
neko-fire / gist:2651748
Created May 10, 2012 07:44
TypoScript: custom abstract field
seite.headerData.20 = TEXT
seite.headerData.20.data = field:abstract
seite.headerData.20.wrap = <style> | </style>
@neko-fire
neko-fire / gist:2651753
Created May 10, 2012 07:45
JavaScript: Popup function
function kompassImage(imgsrc){
var pop;
pop = window.open(imgsrc,'_blank','width=1969,height=1000,status=yes,scrollbars=yes,resizable=yes');
pop.focus();
with (kompass.document){
writeln('<html><head><title></title>');
writeln('</head><body><a href="javascript:close();" style="display:block;">');