Skip to content

Instantly share code, notes, and snippets.

View shrayasr's full-sized avatar

Shrayas Rajagopal shrayasr

View GitHub Profile
@shrayasr
shrayasr / titbits.txt
Last active August 29, 2015 14:12
Programming titbits
// C# | Sorted list, and iterating through them
int value = 1;
SortedList<string, int> sl = new SortedList<string, int>();
sl.add("key", value)
foreach(KeyValuePair<string,int> kv in sl)
{
Console.WriteLine(kv.Key + "=>" + kv.Value);
}

Trello CSS Guide

“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”

You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?

This is where any fun you might have been having ends. Now it’s time to get serious and talk about rules.

Writing CSS is hard. Even if you know all the intricacies of position and float and overflow and z-index, it’s easy to end up with spaghetti code where you need inline styles, !important rules, unused cruft, and general confusion. This guide provides some architecture for writing CSS so it stays clean and ma

@shrayasr
shrayasr / sort-and-awk-inside-file.md
Last active August 29, 2015 14:16
Summing a list of numbers from within a file using the shell

File containing numbers

Andaman Nicobar,25
Andhra Pradesh,3550
Arunachal Pradesh,37
Assam,616
Bihar,1777
Chandigarh,32
Chhattisgarh,313
Dadra & Nagar Haveli,3
@shrayasr
shrayasr / emmet-awesomeness.md
Last active August 29, 2015 14:17
Emmet Awesomeness

Emmet Awesomeness

Lets face it, writing HTML is really not a fun thing to do. With so many < and so many > and all the horrific closing tags. There has to be a better way.

Enter Emmet. Emmet is a plugin for many text editors that makes the job of writing HTML super easy. It provides a bunch of abbreviations whose syntax is inspired by CSS.

@shrayasr
shrayasr / keybase.md
Created March 25, 2015 18:24
keybase.md

Keybase proof

I hereby claim:

  • I am shrayasr on github.
  • I am shrayasr (https://keybase.io/shrayasr) on keybase.
  • I have a public key whose fingerprint is 12A3 E09D 419C 1251 CEDA 92F9 3375 F9A3 8F7E CFC6

To claim this, I am signing this object:

@shrayasr
shrayasr / mountsharedfolder.md
Last active August 29, 2015 14:23
Mounting a shared folder on ubuntu using Virtual Box
  • Create a transient shared folder via virtualbox shared folder settings. Note down the name of the created folder

  • Create a folder in your home directory where you want to mount this share

      $ mkdir ~/share
    
  • Issue the command to mount the Vbox share in the directory just created

$ sudo mount -t vboxsf ~/share/

public class AccountController : Controller
{
//
// GET: /Account/
public ActionResult Index()
{
return RedirectToAction("Login");
}
@shrayasr
shrayasr / rmwindows10.bat
Created August 2, 2015 13:55
Remove onedrive from windows 10
@echo off
cls
set x86="%SYSTEMROOT%\System32\OneDriveSetup.exe"
set x64="%SYSTEMROOT%\SysWOW64\OneDriveSetup.exe"
echo Closing OneDrive process.
echo.
taskkill /f /im OneDrive.exe > NUL 2>&1
ping 127.0.0.1 -n 5 > NUL 2>&1
@shrayasr
shrayasr / 0_start
Last active August 29, 2015 14:27
lein-ring setting readonly attribute to files on windows
# Start a new compojure project
$ lein new compojure win-ro-problem-test
@shrayasr
shrayasr / snl.clj
Last active September 14, 2015 09:48
Snakes and Ladders - Functional Conf 2015 - Code Jugalbandi challenge
(def snls {2 99 ; ladder
7 70 ; ladder
71 3 ; snake
50 5 ; snake
98 1 ; snake
})
(defn roll-dice []
(+ (rand-int 6) 1))