Skip to content

Instantly share code, notes, and snippets.

View swarajd's full-sized avatar

Swaraj Dhumne swarajd

View GitHub Profile
import time
time.sleep(6)
print("ayy")
print("hello world")
@swarajd
swarajd / .vimrc
Last active December 6, 2017 21:28
"
" A (not so) minimal vimrc.
"
" You want Vim, not vi. When Vim finds a vimrc, 'nocompatible' is set anyway.
" We set it explicitely to make our position clear!
set nocompatible
filetype plugin indent on " Load plugins according to detected filetype.
syntax on " Enable syntax highlighting.
"graphData": {
"nodes": [
{
"data": {
"id": "A",
"fname": "A",
"zone": "#FBDCD6"
}
},
{
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.cytoscape=e()}}(function(){return function e(t,r,n){function i(o,s){if(!r[o]){if(!t[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(a)return a(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[o]={exports:{}};t[o][0].call(c.exports,function(e){var r=t[o][1][e];return i(r?r:e)},c,c.exports,e,t,r,n)}return r[o].exports}for(var a="function"==typeof require&&require,o=0;o<n.length;o++)i(n[o]);return i}({1:[function(e,t,r){/*!
Cytoscape.js 3.1.2 (MIT licensed)
Copyright (c) The Cytoscape Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the “Software”), to deal in
the Software without restricti

@startuml autonumber participant A participant B participant C

A -> B: AB
note left: AB note
A -> C: AC
import { h, Component } from 'preact';
import cytoscape from 'cytoscape';
import cyqtip from 'cytoscape-qtip';
import cydagre from 'cytoscape-dagre';
cyqtip(cytoscape);
cydagre(cytoscape);
export default class Diagram extends Component {
function readFile(e) {
e.preventDefault();
document.getElementById("loading").hidden = false;
document.getElementById("downloadbtns").hidden = true;
var f = e.target[1].files[0];
if (f) {
var fr = new FileReader();
fr.onload = function(e) {
var contents = e.target.result;
console.log(contents);
%object falling down
clear; clc; clf;
TIME = linspace(0,10);
DIST = 0 + 0*TIME + 0.5 * -9.8 * TIME.^2;
plot(TIME, DIST, '*');
%pendulum swinging from side to side
clear; clc; clf;
TIME = linspace(0,10);
T = 20; %half of the period
DIST = 0*TIME + 5;
step = T:2*T:length(TIME);
DIST(step) = 0.1;
plot(TIME, DIST, '*');
axis([0, 10, 0, 6]);