Showing posts with label Javascript. Show all posts

Debug javascript in smarter way console.table()

by in 0

Works in Chrome and Firefox
Via mariusschulz.com

LOGGING ARRAY DATA WITH CONSOLE.LOG()

Imagine you have created this list of programming languages and their file extensions:
var languages = [
    { name: "JavaScript", fileExtension: ".js" },
    { name: "TypeScript", fileExtension: ".ts" },
    { name: "CoffeeScript", fileExtension: ".coffee" }
];

console.log(languages);
The console.log() call will give you the following representation of your data:
Console Output for console.log
That tree view is helpful for debugging purposes, but I find it a little cumbersome to have to open every collapsed object manually. I'm saying we can do a little better withconsole.table().

LOGGING ARRAY DATA WITH CONSOLE.TABLE()

Instead of calling console.log(), we'll use console.table() now:
console.table(languages);
Make sure the console is opened before refreshing the page, otherwise you won't see any output. If you did everything correct, you'll be rewarded with this nice, little table view:
Console Output for console.table()
Pretty neat, isn't it?
Of course, tables work best for tabular data. If all the objects have a totally different structure, you'll end up with most of the cells containing undefined values. Still, the property values are neatly arranged and give you a good overview.

LOGGING OBJECT DATA WITH CONSOLE.TABLE()

Another nice thing about console.table() is that it also works with objects:
var languages = {
    csharp: { name: "C#", paradigm: "object-oriented" },
    fsharp: { name: "F#", paradigm: "functional" }
};

console.table(languages);
Console Output for console.table() called with an object
'nuff said.

FILTERING THE DISPLAYED OBJECT PROPERTIES

If you want to restrict the columns to certain properties, you can pass an array of their keys as a second parameter to the console.table() call:
// Multiple property keys
console.table(languages, ["name", "paradigm"]);
For a single property, a simple string is sufficient:
// A single property key
console.table(languages, "name");Via mariusschulz.com

Standalone Charting Library With HTML5 Canvas

by in , 0


Chart.js is an impressive JavaScript charting library that is built on top of HTML5 canvas.
It currently supports 6 chart types (line, bar, radar, pie, column and polar area) and all this comes in a standalone, <5kb package.
Chart.js
Colors, fonts, borders and their sizes can all be customized. Also, optionally, charts can be loaded with an animation.

Javascript library that can create PDF.[jsPDF]

by in 0

jsPDF
Javascript တမျိုးတည်းကိုသာ အသုံးပြုထားပြီး Server side script တခုမှမလိုတဲ့ pdf creation library ပါ။ browser အဟောင်းတွေအတွက်လည်း flash fall back ထည့်ထားပေးပါတယ်။
http://jspdf.com/ မှာ အသုံးပြုပုံ demo များကို ကြည့်နိုင်ပါတယ်။ 
full source code  ကို https://github.com/MrRio/jsPDF မှာ ကြည့်နိုင်ပါတယ်။

Awesome Media Queries in JavaScript [enquire.js]

by in , 0

Enquire.js က Css Media queries တွေကို programmatically response လုပ်ဖို့အတွက် သုံးတာပါ၊ ဖိုင်ဆိုဒ်က 1kb အောက်မှာပဲရှိပါတယ်။ CSS Media query တွေနဲ့တင် မတူညီတဲ့ screen တွေအတွက် ဒီဇိုင်းလုပ်ရာမှာ တော်တော်အလုပ်ဖြစ်နေပါပြီ၊ အဲဒိထက်ပိုပြီး javascript ကနေ control ပါလိုချင်တယ်ဆိုရင်တော့ Enquire.js  ကိုသုံးတာ အလွယ်ဆုံးပဲလို့ ထင်ပါတယ်။
Documentation နဲ့ အသုံးပြုပုံကို  http://wickynilliams.github.com/enquire.js မှာ သွားကြည့်နိုင်ပါတယ်။

 

Awesome Open Source jQuery Timeline

by in , , 0

Customize လုပ်လို့လွယ်တဲ့ jQuery Timeline လေးပါ။ မေ့မသွားခင် ဘလော့ဂ်ပေါ်တင်လိုက်ပါတယ်။ 
Data တွေကို JSON, HTML, Google Document  ကြိုက်တဲ့ format သုံးပြီး timeline မှာ ပြလို့ရပါတယ်။ 
စိတ်ဝင်စားတယ်ဆိုရင် အသေးစိတ်ကို   http://timeline.verite.co/ မှာ သွားကြည့်နိုင်ပါတယ်။

Standalone Javascript Notifications - Smoke.js

by in , , 0

အပျင်းထူနေတာရယ် အချိန်မရတာရယ်ကြောင့် (အပျင်းထူတာက ပိုပါတယ် ဟီး)ပိုစ်မတင်ဖြစ်တာတောင် ကြာပေါ့။ တင်မယ်ဆိုပြီး bookmark လုပ်ထားတာတွေတောင် အများကြီး ဖြစ်ကုန်ပြီး ဘာကို တင်လို့တင်ရမှန်း မသိတော့ဘူး။ လင့်တွေ တော်တော်များများက google reader မှာ ဖတ်ပြီးသွားရင် ၂ရက်လောက်နေရင် မေ့သွားရော၊ နောက် လိုတော့ ပြန်ရှာတော့ မတွေ့တော့ဘူး။ ဘလော့ပေါ်တင်ထားလိုက်တော့ ပြန်ရှာရလွယ်သွားတယ်။ စိတ်ဝင်စားတဲ့လူတွေ အသုံးတည့်မယ်သူတွေ တွေ့တော့လဲ ယူသုံးလို့ရသွားတာပေါ့။ 
 
smoke.js က တခြား library တွေကို မမှီခိုတဲ့ Standalone Javascript Notification Library တခုပါ။ မြန်မာလို ဆိုရင်တော့ တစ်ကိုယ်တည်း မတ်တပ်ကြီးရပ်နေတဲ့ ဂျာဘားစခရစ် နဲ့ သတိပေးတဲ့ စာကြည့်တိုက်ကြီးပေါ့ တိန်.. မဟုတ်သေးပါဘူး :D အလကားပြောတာ၊
http://ssssnakes.com/smoke/ မှာ သွားကြည့်ကြည့်ပါ၊ ဆိုဒ်သေးသေးလေးနဲ့ သုံးရလွယ်ပြီး တော်တော်လန်းတယ်။ standalone ဖြစ်တဲ့အတွက် jQuery တို့ဘာတို့မလိုပဲ သူ့ချည်းပဲလဲ သုံးလို့ရပါတယ်။

Tinycon : Dynamic Faforite Icon

by in 0

Tinycon : A small library for manipulating the favicon 

Faforite icon ပေါ်မှာ နံပတ်လေးတွေ နဲ့ ပြချင်တာမျိုး (ဥပမာ tweet ဘယ်နှစ်ခု အသစ်ရောက်နေတာတို့၊ email မဖတ်ရသေးတာ ဘယ်နှစောင် ရှိတယ်တို့ အစရှိတဲ့ လေးတွေ ပြချင်တာမျိုးဆို ဒီ Javascript Library လေးက တော်​တော် အသုံးဝင်မယ်ထင်ပါတယ်။ 
ဒီမှာ သွားကြည့်နိုင်ပါတယ်။ 

Adipoli| Awesome jQuery Image Hover Plugin

by in , , 0

Its Easy to implement
The effects are cool.
Check out Adipoli jQuery Plugin.  

ဆိုဒ်လဲ သိပ်မကြီးဘူး၊ သုံးရတာလဲ လွယ်တယ်၊ လှလဲတော်တော်လှတဲ့ jQuery Image Hover Effect Plugin တခုပါ။ အသုံးပြုပုံ အသေးစိတ်ကို ဒီမှာ သွားကြည့်နိုင်ပါတယ်။

KineticJS : HTML5 Canvas JavaScript library

by in , , 0

KineticJS က HTML5 Canvas Library တခုပါ။ အသေးစိတ် သိလိုတယ်ဆိုရင်တော့ http://www.kineticjs.com/ မှာ သွားကြည့်နိုင်ပါတယ် ။
Example တွေကလဲ တော်တော်လန်းပါတယ်။ ကုတ်တိုတိုလေးတွေနဲ့ ထွက်လာတဲ့ result က တော်တော်မိုက်တယ်။
 ဒါကတော့ သူ့ဆိုက်ထဲမှာ ရေးထားတာ.
KineticJS is an HTML5 Canvas JavaScript library that extends the 2d context by enabling canvas interactivity for desktop and mobile applications.
You can draw your own shapes or images using the existing canvas API, add event listeners to them, move them, scale them, and rotate them independently from other shapes to support high performance animations, even if your application uses thousands of shapes.  Served hot with a side of awesomeness
ဒါကတော့ ဥပမာတွေထဲက တခုပါ။

Learn Javascript Frameworks with TodoMVC

by in , 16

If you are a lazy geek like me, you need short-cut way to learn Javascript frameworks.
The fastest way is to learn by example.
So, here is TodoMVC, one simple to do list application in almost all popular javascript frameworks.

Check this out!!.

Developers these days are spoiled with choice when it comes to selecting an MV* framework for structuring and organizing JavaScript web apps. Backbone, Spine, Ember (SproutCore 2.0), JavaScriptMVC... the list of new and stable solutions goes on and on, but just how do you decide on which to use in a sea of so many options?
To help solve this problem, we created TodoMVC - a project which offers the same Todo application implemented using MV* concepts in most of the popular JavaScript MV* frameworks of today.
Solutions look and feel the same, have a common simple feature-set and make it easy for you to compare the syntax and structure of different frameworks so you can select the one you feel the most comfortable with.
get TodoMVC on Github