Skip to content

Instantly share code, notes, and snippets.

View motyar's full-sized avatar
🟢
I may be slow to respond.

Motyar motyar

🟢
I may be slow to respond.
View GitHub Profile
@motyar
motyar / out.xml
Created August 4, 2014 06:12
out.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<books>
<course number="1">
<name>First course</name>
<page>1</page>
</course>
<course number="2">
<name>Getting started</name>
<page>2</page>
</course>
# Simple test for gist.io
This is second line
-------------------
I dont have much to write just now.
` try
code
sd `
@motyar
motyar / .vimrc
Last active August 29, 2015 13:57
Auto start and stop ssh tunnel, for super fast remote editing with Vim
"{{{ Start and stop ssh tunnel, Fast remote editing idea via http://www.erikzaadi.com/2013/03/07/fast-remote-editing-with-vim/
function! StartSshTunnel(machine)
let shellcmd = "ssh ".a:machine." -f -N -o ControlMaster=auto -o ControlPath=/tmp/%r@%h:%p"
let tunnel=system(shellcmd)
endfunction
function! StopSshTunnel()
let kill = system("lsof -i -n | grep ssh | awk '{print $2}' | xargs kill -9")
endfunction
@motyar
motyar / fireFly
Created January 11, 2012 13:28
FireFly Effect on web
<!doctype html>
<head>
<style>
body{
background:black;
}
#header{
width:700px;
height:300px;
@motyar
motyar / json_template.html
Created December 15, 2011 09:13
Displaying JSON values with JavaScript : Basics of JSON Template with JavaScript
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Displaying JSON values with JavaScript : Basics of JSON Templating with JavaScript</title>
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<style>
article, aside, figure, footer, header, hgroup,
@motyar
motyar / Simplest AJAX
Created November 24, 2011 07:17
Simplest AJAX call with Raw JavaScript
window.onload = function(){
var xhr;
if(typeof XMLHttpRequest !== 'undefined') xhr = new XMLHttpRequest();
else {
var versions =["MSXML2.XmlHttp.5.0","MSXML2.XmlHttp.4.0","MSXML2.XmlHttp.3.0","MSXML2.XmlHttp.2.0","Microsoft.XmlHttp"];
for(var i = 0, len = versions.length; i < len; i++) {
try {
function typewriter(el,text,pos,no){
ctext=text.substring(0,pos)+(pos%2?'_':'&lt;blink&gt;_&lt;/blink&gt;');
$(el).html(ctext);
if(pos==text.length){
$(el).html(text+"&lt;blink&gt;_&lt;/blink&gt;");
}
else
window.setTimeout('typwriter("'+el+'","'+text+'",'+(pos+1)+','+1+');',800);
}