Skip to content

Instantly share code, notes, and snippets.

@andrijac
andrijac / break.js
Last active October 11, 2015 15:27
Break at the beginning of any function in javascript
var __break = (function() {
"use strict";
// as we need to keep original functions, we will use clousers to keep a original functions here.
var cache = {},
cArray = function(args) { return Array.prototype.slice.call(args); },
concat = function() { return cArray(arguments).join(""); };
// funcName - name of the function, full name accessable from global object.
@andrijac
andrijac / shortcut_test.htm
Created October 30, 2012 09:04
shortcuts test
<html>
<head>
<style>
body {
background-color: inactivecaptiontext;
}
</style>
<title>charCode/keyCode/which example</title>
<!--<script src="shortcuts.js" type="text/javascript"></script>-->
@andrijac
andrijac / .hgignore
Last active October 12, 2015 12:37
hgignore
# use glob syntax
syntax: glob
node_modules/
*.csproj.user
*.obj
*.pdb
*.user
*.aps
*.pch
@andrijac
andrijac / tumblr.customize.user.js
Created November 15, 2012 19:30
remove click-through link, scroll down to save button
// ==UserScript==
// @name Tumblr customization
// @description remove click-through link, scroll down to save button
// @include http://www.tumblr.com/reblog/*
// ==/UserScript==
(function() {
var get = function(id) { return document.getElementById(id); },
linkField = get('post_three'),
saveButton = get('save_button');
@andrijac
andrijac / search_for_text_in_sp.sql
Created November 20, 2012 05:55
sybase - search for text in stored procedure
select * from syscomments sc, sysobjects so where so.id = sc.id and so.type = 'P' and user_name(so.uid) = 'dbo' and text like '%some text%'
/* group by name */
select so.name from syscomments sc, sysobjects so where so.id = sc.id and so.type = 'P' and user_name(so.uid) = 'dbo' and sc.text like '%some text%' group by so.name
@andrijac
andrijac / backup_tfs.bat
Created December 12, 2012 14:38
Backup TFS databases
@echo off
set osql="C:\Program Files\Microsoft SQL Server\100\Tools\Binn\OSQL.EXE"
set wzzip="C:\Program Files (x86)\WinZip\wzzip.exe"
set backup_location=C:\temp\
set archive_location=C:\temp\
set server_name=(local)\SQLEXPRESS
set database01=Tfs_DefaultCollection
set database02=Tfs_Configuration
@andrijac
andrijac / exception_func_test.cs
Created January 13, 2013 09:26
Test speed with and without exception. Exception Driven Development (EDD) (:
using System;
using System.Diagnostics;
namespace ConsoleApplication1
{
class Program
{
private static Action<object> wl = o => Console.WriteLine(o.ToString());
static void Main(string[] args)
@andrijac
andrijac / clientaccesspolicy.xml
Created February 10, 2013 06:43
Cross domain access, HTTPS enabled
<?xml version="1.0" encoding="utf-8" ?>
<access-policy>
<cross-domain-access>
<policy>
<allow-from http-request-headers="*">
<domain uri="http://*"/>
</allow-from>
<grant-to>
<resource path="/" include-subpaths="true"/>
</grant-to>
:: use: CALL read_last_line.bat "filename"
:: used: http://stackoverflow.com/a/523301/84852
@echo off
setLocal EnableDelayedExpansion
for /f "tokens=* delims= " %%a in (%1) do (
set var=%%a
)
---------- Forwarded message ----------
From: Mark S. Miller <erights@google.com>
Date: Tue, Nov 16, 2010 at 3:44 PM
Subject: "Future of Javascript" doc from our internal "JavaScript Summit"
last week
To: javascript-standard@google.com
On November 10th and 11th, a number of Google teams representing a variety
of viewpoints on client-side languages met to agree on a common vision for
the future of Javascript.