Skip to content

Instantly share code, notes, and snippets.

(function(obj) {
var propList = [];
for(var i in obj) {
propList.push(i);
propList.push('\r\n');
}
return propList.join('');
@andrijac
andrijac / console.js
Created March 5, 2014 10:41
Node.js console boilerplate
var readline = require('readline');
var toArray = function(){return Array.prototype.slice.call(arguments[0]);}
var log = function() {
var arr = toArray(arguments).map(function(v) {
// debugger;
return v + '';
});
console.log(arr.join(" "));
}
@andrijac
andrijac / line_count.sql
Created April 22, 2014 08:09
Find line count in SQL server stored procedures.
SELECT o.type_desc AS ROUTINE_TYPE
,QUOTENAME(s.[name]) + '.' + QUOTENAME(o.[name]) AS [OBJECT_NAME]
,(LEN(m.definition) - LEN(REPLACE(m.definition, CHAR(10), ''))) AS LINES_OF_CODE
FROM sys.sql_modules AS m
INNER JOIN sys.objects AS o
ON m.[object_id] = o.[OBJECT_ID]
INNER JOIN sys.schemas AS s
ON s.[schema_id] = o.[schema_id]
order by LINES_OF_CODE desc
@andrijac
andrijac / readme.md
Last active August 29, 2015 14:00
WCF trace

"Program Files"\Microsoft SDKs\Windows\v6.1\Bin\SvcTraceViewer.exe

/\_/\
____/ o o \
/~____ =ø= /
(______)__m_m)
@andrijac
andrijac / wget.js
Created June 1, 2014 13:27
Download file using node.js, proxy is included.
var http = require('http');
var fs = require('fs');
var readline = require('readline');
var path = require('path');
var rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
if (process.argv.length < 3) {

JSConf Slides, Codes and Notes

These are all the JSConf 2014 slides, codes, and notes I was able to cull together from twitter. Thanks to the speakers who posted them and thanks to @chantastic for posting his wonderful notes.

Modular frontend with NPM - Jake Verbaten (@Raynos)

@andrijac
andrijac / Threading.cs
Created June 5, 2014 07:29
C# Threading
// http://stackoverflow.com/a/363409/84852
System.Threading.ThreadPool.QueueUserWorkItem(delegate {
DoSomethingThatDoesntInvolveAControl();
}, null);
// http://stackoverflow.com/a/661662/84852
///...blah blah updating files
string newText = "abc"; // running on worker thread
this.Invoke((MethodInvoker)delegate {
@andrijac
andrijac / AzureStorageManager.cs
Created July 7, 2014 13:54
Azure storage manager (Block Blob)
using System;
using System.IO;
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Blob;
namespace AzureProject
{
public class AzureStorageManager
{
____
(. \
\ |
\ |___(\--/)
__/ ( . . )
"'._. '-.O.'
'-. \ "|\
'.,,/'.,,mrf