Skip to content

Instantly share code, notes, and snippets.

Avatar

Ivan Vasilov ivasilov

  • Skopje, Macedonia
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am ivasilov on github.
  • I am ivasilov (https://keybase.io/ivasilov) on keybase.
  • I have a public key ASCTxBbsDq89anH7wMOzq-TYqdfR_gjgPdObrFKScOLEWwo

To claim this, I am signing this object:

@ivasilov
ivasilov / gulpfile.js
Created Aug 14, 2015
Gulpfile with webpack, typescript and nodemon
View gulpfile.js
var gulp = require("gulp");
var gutil = require("gulp-util");
var rename = require('gulp-rename');
var webpack = require("webpack");
var nodemon = require('nodemon');
var typescript = require('gulp-typescript');
// These tasks setup nodemon.
gulp.task("start", function(cb) {
var options = {
View invoicesview.coffee
InvoiceListView = require('views/invoiceListView').InvoiceListView
InvoicesTemplate = require('views/templates/invoices')
class exports.InvoicesView extends Backbone.View
events:
'click #next' : 'nextPage'
'click #prev' : 'prevPage'
initialize: ->
View item.coffee
# My model
class exports.Item extends Backbone.Model
validation:
item:
required: true
quantity:
required: true
pattern: 'number'
price:
required: true
@ivasilov
ivasilov / nativeHeap.java
Created Nov 8, 2011
Code for logging native heap usage on Android
View nativeHeap.java
public static void logHeap(Class clazz) {
Double allocated = new Double(Debug.getNativeHeapAllocatedSize())/new Double((1048576));
Double available = new Double(Debug.getNativeHeapSize())/1048576.0;
Double free = new Double(Debug.getNativeHeapFreeSize())/1048576.0;
DecimalFormat df = new DecimalFormat();
df.setMaximumFractionDigits(2);
df.setMinimumFractionDigits(2);
String APP = "Bitmap";
Log.d(APP, "debug. =================================");
View C deserialization.cs
public Person Deserialize(string file)
{
XmlSerializer serializer = new XmlSerializer(typeof(Person));
Stream reader = new FileStream("myXmFile.xml", FileMode.Open);
Person temp=(Person)serializer.Deserialize(reader);
reader.Close();
return temp;
}