This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import kivy | |
kivy.require('1.4.0') | |
from kivy.app import App | |
from kivy.uix.widget import Widget | |
from kivy.uix.camera import Camera | |
from kivy.uix.button import Button | |
from kivy.core.window import Window | |
class MyApp(App): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from kivy.app import App | |
from kivy.uix.gridlayout import GridLayout | |
from kivy.uix.label import Label | |
from kivy.uix.textinput import TextInput | |
class LoginScreen(GridLayout): | |
def __init__(self , **kwarge): | |
super(LoginScreen,self).__init__(**kwarge) | |
self.cols = 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from kivy.app import App | |
from kivy.uix.image import Image | |
from kivy.uix.widget import Widget | |
class showimage(Image): | |
pass | |
class MyApp(App): | |
def build(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
http.createServer(function (request, response) { | |
response.writeHead(200, {'Content-Type': 'text/plain'}); | |
response.end('Hello World\n'); | |
}).listen(8124); | |
console.log('Server running at http://127.0.0.1:8124/'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require("fs"); | |
console.log("Read File ...."); | |
var conf = JSON.parse(fs.readFileSync("config.json")); | |
console.log("One : ", conf); | |
fs.watchFile("config.json", function(current,previous){ | |
console.log("File Changed ..."); | |
var conf = JSON.parse(fs.readFileSync("config.json")); | |
console.log("Two : " , conf); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fs.rename(oldPath, newPath, callback)# | |
Asynchronous rename(2). No arguments other than a possible exception are given to the completion callback. | |
fs.renameSync(oldPath, newPath)# | |
Synchronous rename(2). | |
fs.ftruncate(fd, len, callback)# | |
Asynchronous ftruncate(2). No arguments other than a possible exception are given to the completion callback. | |
fs.ftruncateSync(fd, len)# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var path = require('path'); | |
path.normalize('/a/.///b/d/../c/') | |
'/a/b/c/' | |
// '.' for 'this directory' and '..' for 'one level up' | |
var path = require('path'); | |
var url = '/index.html'; | |
path.join(process.cwd(), 'static', url); | |
'/home/nico/static/index.html' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
show dbs | |
// LIst Data Base | |
show collections | |
// List Collections | |
use test | |
// Select Db | |
db |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function validatePassword($password) | |
{ | |
return $this->hashPassword($password)===$this->password; | |
} | |
public function hashPassword($password) | |
{ | |
return md5($password); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Module dependencies. | |
*/ | |
var express = require('express'); | |
var routes = require('./routes'); | |
var fs = require("fs"); | |
var mongoose = require('mongoose'); | |