Skip to content

Instantly share code, notes, and snippets.

View k33g's full-sized avatar
💭
Read my code at https://gitlab.com/k33g

Philippe Charrière k33g

💭
Read my code at https://gitlab.com/k33g
View GitHub Profile
@k33g
k33g / ipad4joB.css
Created November 28, 2010 10:38
css sheet for JoApp (ipad like)
/*
ipad4joB.css
*/
.no-copy{-webkit-user-select:none;}
body {
margin: 0;
padding: 0;
background: #EEE;
@k33g
k33g / gist:729903
Created December 6, 2010 05:09
Two columns iPad layout template for SenchaTouch (Javascript : ipad-template.js)
Ext.setup({
icon: 'icon.png',
tabletStartupScreen: 'tablet_startup.png',
phoneStartupScreen: 'phone_startup.png',
glossOnIcon: false,
onReady: function() {
//---------------------------------
// Title Bar
//---------------------------------
var header = new Ext.Toolbar({
@k33g
k33g / gist:729906
Created December 6, 2010 05:10
Two columns iPad layout template for SenchaTouch (HTML : ipad-template.html)
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>SenchaTouch</title>
<link rel="stylesheet" href="sencha-touch.css" type="text/css">
<script type="text/javascript" src="sencha-touch.js"></script>
<script type="text/javascript" src="ipad-template.js"></script>
</head>
<body></body>
</html>
@k33g
k33g / gist:743178
Created December 16, 2010 07:54
android css for Jo
/*
htc4jo.css
*/
.no-copy{-webkit-user-select:none;}
body {
margin: 0;
padding: 0;
background: #383838;;
@k33g
k33g / gist:749547
Created December 21, 2010 05:44
JoApp StarterKit
//Jo StarterKit
//by [email protected]
// initialize jo
jo.load();
/*---[DEFINE MAIN SCREEN]---------------------------------------*/
var MainScreen;
var HeaderBar;
var Content;
@k33g
k33g / gist:778460
Created January 13, 2011 19:42
java like inheritance and shameful use of prototype
function Human(){
var that = this;
var name="John Doe";
that.getName=function(){return name;}
that.setName=function(value){name=value;}
return that;
}
function Man(){
@k33g
k33g / gist:791813
Created January 23, 2011 04:17
"json service" with node.js
var
sys = require('sys'),
http = require('http');
function myservice(){/*return objects*/}
http.createServer(function (req, res) {
/* url to call service :
http://localhost:3000/woman:lara:croft
*/
@k33g
k33g / gist:807390
Created February 2, 2011 08:00
Annotations for js
function Annotations(){
var arr = arguments[0].toString().split("@@"),arr_annot={},i,j,tmp={};
for(i=0;i<arr.length;i++){
if(arr[i][0]=="-"){
arr_annot[arr[i].split("-")[1]] ={};
tmp = arr[i].split("-")[2].split(",");
tmp[0]=tmp[0].replace(/\n/g,"").replace(/\r/g,"").replace(/^\s+|\s+$/,"");
tmp[1]=tmp[1].replace(/\n/g,"").replace(/\r/g,"").replace(/^\s+|\s+$/,"");
for(j=0;j<tmp.length;j++){
@k33g
k33g / gist:807392
Created February 2, 2011 08:03
use of "Annotations for js"
function Human(){
/* @@-FirstName-
myType:TEXT,
myDefaultValue:John
@@ */
this.FirstName;
/* @@-LastName-
myType:TEXT,
myDefaultValue:Doe
@@ */
@k33g
k33g / gist:823684
Created February 12, 2011 10:44
une autre version de classe en js avec héritage
var mum = (function () {
var mummy = {};
mummy.Class = function(definition){
var that = function(){},m,mb,mbs,mbc,inst;
for(m in definition){
switch(m){
case 'Members':for(mb in definition.Members){that.prototype[mb] = definition.Members[mb];}break;
case 'Static':for(mbs in definition.Static){that[mbs] = definition.Static[mbs];}break;
case 'Extends':that.prototype = new definition.Extends;break;
case 'Init':