Skip to content

Instantly share code, notes, and snippets.

View ivasilov's full-sized avatar

Ivan Vasilov ivasilov

  • Supabase
  • Skopje, Macedonia
  • 23:04 (UTC +01:00)
View GitHub Profile
@ivasilov
ivasilov / C deserialization.cs
Created October 26, 2011 22:08
XML serialization
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;
}
@ivasilov
ivasilov / nativeHeap.java
Created November 8, 2011 12:43
Code for logging native heap usage on Android
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. =================================");
@ivasilov
ivasilov / item.coffee
Created February 7, 2012 23:07
Model validation
# My model
class exports.Item extends Backbone.Model
validation:
item:
required: true
quantity:
required: true
pattern: 'number'
price:
required: true
@ivasilov
ivasilov / invoicesview.coffee
Created February 10, 2012 12:42
Faulty view
InvoiceListView = require('views/invoiceListView').InvoiceListView
InvoicesTemplate = require('views/templates/invoices')
class exports.InvoicesView extends Backbone.View
events:
'click #next' : 'nextPage'
'click #prev' : 'prevPage'
initialize: ->
@ivasilov
ivasilov / gulpfile.js
Created August 14, 2015 13:51
Gulpfile with webpack, typescript and nodemon
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 = {

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: