Skip to content

Instantly share code, notes, and snippets.

View ivlists's full-sized avatar

Vaibhav ivlists

  • Microsoft corporation
  • Bangalore
View GitHub Profile
@alexyork
alexyork / gist:1405081
Created November 29, 2011 14:58
Running code in Parallel in C#
// Running code in Parallel in C#
// Sequential
DoSomething();
DoSomethingElse();
DoAnotherThing();
// Parallel
Parallel.Invoke(
DoSomething,
@jakeonrails
jakeonrails / Ruby Notepad Bookmarklet
Created January 29, 2013 18:08
This bookmarklet gives you a code editor in your browser with a single click.
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
@jdkanani
jdkanani / notepad.html
Last active June 16, 2024 13:44 — forked from jakeonrails/Ruby Notepad Bookmarklet
This bookmarklet gives you a code editor in your browser with a single click.
data:text/html, <style type="text/css">.e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div class="e" id="editor"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("editor");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
<!--
For other language: Instead of `ace/mode/ruby`, Use
Markdown -> `ace/mode/markdown`
Python -> `ace/mode/python`
C/C++ -> `ace/mode/c_cpp`
Javscript -> `ace/mode/javascript`
Java -> `ace/mode/java`
Scala- -> `ace/mode/scala`
@ivlists
ivlists / Google Docs encryption
Last active July 17, 2017 21:00 — forked from vicmortelmans/gist:1391229
Blowfish encryption library implementation for Google app scripts (Precisely - Docs).
function escape(t)
{
var r='';
for(var i=0;i<t.length;i++){
var c=t.charCodeAt(i);
var t1=Math.floor(c/16);
var t2=c%16;
if (t1<10) t1+=48;
else t1+=55;
if (t2<10) t2+=48;
@zenorocha
zenorocha / multiple-3rd-party-widgets.js
Last active November 14, 2022 12:18
Loading multiple 3rd party widgets asynchronously
(function() {
var script,
scripts = document.getElementsByTagName('script')[0];
function load(url) {
script = document.createElement('script');
script.async = true;
script.src = url;
scripts.parentNode.insertBefore(script, scripts);
@ivlists
ivlists / Browserutility.cs
Last active December 17, 2015 10:59
Includes - A Number of useful functions and utilities to find WebElement effectively and reliably using selenium web driver for UI automation. ElementLocator : 1. FindElementSmart() - Which finds WebElement on web page intelligently using Multiple search criteria like by Xpath, Id, Name, ClassName, Value, LinkText, PartialLinkText etc. 2. Good e…
// --------------------------------------------------------------------------------------------------------------------
// <summary>
// @Description - browser class contains browser specific methods such as launching the browser
// and checking whether the browser is exist or not.
// @Author - Vaibhav
// @Date - 01 / 03 / 2012
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace BVT.TestCases.Utilities
{
@nzthiago
nzthiago / download.ps1
Last active December 18, 2015 05:59 — forked from erichexter/download.ps1
Download TechEd North America videos with video code prepended to file name
[Environment]::CurrentDirectory=(Get-Location -PSProvider FileSystem).ProviderPath
$rss = (new-object net.webclient)
#Set the username for windows auth proxy
#$rss.proxy.credentials=[system.net.credentialcache]::defaultnetworkcredentials
$a = ([xml]$rss.downloadstring("http://channel9.msdn.com/Events/TechEd/NorthAmerica/2013/RSS/mp4high"))
$a.rss.channel.item | foreach{
$code = $_.comments.split("/") | select -last 1
$url = New-Object System.Uri($_.enclosure.url)
$file = $code + "-" + $_.creator + "-" + $_.title.Replace(":", "-").Replace("?", "").Replace("/", "-").Replace("<", "") + ".mp4"
if (!(test-path $file))
@nzthiago
nzthiago / downloadBUILD2013.ps1
Created July 1, 2013 11:05
Download all BUILD 2013 sessions and powerpoint slides
# Based on script from http://www.toddklindt.com/Scripts/downloadmp4-pptx.ps1.txt
[Environment]::CurrentDirectory=(Get-Location -PSProvider FileSystem).ProviderPath
$rss = (new-object net.webclient)
# Grab the RSS feed for the MP4 downloads
$a = ([xml]$rss.downloadstring("http://channel9.msdn.com/Events/Build/2013/RSS/mp4high"))
# Walk through each item in the feed
$a.rss.channel.item | foreach{
@vasanthk
vasanthk / System Design.md
Last active July 30, 2024 00:17
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?