Skip to content

Instantly share code, notes, and snippets.

Gergo Bogdan gergob

  • Budapest
Block or report user

Report or block gergob

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Animals.js
/// <reference path="//Microsoft.WinJS.1.0/js/base.js" />
/// <reference path="//Microsoft.WinJS.1.0/js/ui.js" />
(function () {
"use strict";
WinJS.Namespace.define("Zoo", {
Animal: WinJS.Class.define(
gergob / zoo.json
Created Nov 24, 2012
Data of transferred animals
View zoo.json
"name" : "King",
"age" : 5,
"hoursSinceLastFeed" : 3
"name" : "Geeko",
"age" : 2,
"hoursSinceLastFeed" : 12
gergob / buildAnimal.js
Created Nov 24, 2012
buildAnimal function
View buildAnimal.js
buildAnimal: function (model) {
var newAnimal = new Zoo.Animal();
if (model.hasOwnProperty("name")) {
if (model.hasOwnProperty("age")) {
gergob / loadZoo.js
Created Nov 24, 2012
loadZoo function
View loadZoo.js
loadZoo: function (uri) {
return Windows.Storage.StorageFile.getFileFromApplicationUriAsync(uri)
.then(function (file) {
return Windows.Storage.FileIO.readTextAsync(file)
.then(function (textFromFile) {
var myParsedJsonData = JSON.parse(textFromFile);
//this will store all the new animals transferred to zoo
var zoo = new Array();
gergob / processAndDisplayZooJSON.js
Created Nov 24, 2012
Process and display zoo.json
View processAndDisplayZooJSON.js
args.setPromise(WinJS.UI.processAll().then(function() {
//build up the URL for the file added to the project
var url = new Windows.Foundation.Uri("ms-appx:///zoo.json");
//this will store the imported data
var myNewAnimals = new Array();
//invoke the static method which loads the file
//and creates Animal objects from json data
gergob / yes.js
Created Jul 18, 2013
Contains the implementation of linux's yes command.
View yes.js
#!/usr/bin/env node
This small node.js app should do exactly what the yes linux command does.
Quote from man yes:
Repeatedly output a line with all specified STRING(s), or `y'.
gergob / wc.js
Created Jul 26, 2013
Contains the implementation of the wc linux command using node.js
View wc.js
#!/usr/bin/env node
This small node.js app should do exactly what the wc linux command does.
Quote from man wc:
Print newline, word, and byte counts for each FILE, and a total line if more than one FILE is specified. With no FILE, or when FILE is -, read standard
input. A word is a non-zero-length sequence of characters delimited by white space. The options below may be used to select which counts are printed,
always in the following order: newline, word, character, byte, maximum line length.
gergob / fstat.js
Created Jul 26, 2013
contains the node.js fstat methods
View fstat.js
// Method names taken from:
//stats is the return value if fs.statsync(PATH_TO_FILE) method
stats.isSymbolicLink(); //(only valid with fs.lstat())
gergob / hello_vilag.js
Created Oct 23, 2013
FLOSSzine - Programozás Kezdőkenk - Bevezető - Hello Világ!
View hello_vilag.js
//minden szöveg, amelyet // előz meg,
//illetve /* ... */ jelek közzé teszünk
//a JavaScript kommentként kezeli és figyelmen kívül hagyja
alert("Hello Világ!");
gergob / hello.html
Created Oct 23, 2013
FLOSSzine - Programozás Kezdőkenk - Bevezető - Hello Világ!
View hello.html
<!-- HTML fájlokba ezen jelek közzé lehet kommentárokat tenni -->
<!DOCTYPE html>
<!-- HTML dokumentum fej része -->
<!-- Erre azért van szükség, hogy a böngésző meg tudja jeleníteni az ékezetes magyar betüket -->
<meta charset="utf-8">
<!-- Hivatkozunk az előzőekben megírt JavaScript kódfájlunkra -->
<script src="hello_vilag.js" type="text/javascript"></script>
You can’t perform that action at this time.