Skip to content

Instantly share code, notes, and snippets.

View ishan-marikar's full-sized avatar
📚
Learning Data Visualisation and Data Science

Ishan Marikar ishan-marikar

📚
Learning Data Visualisation and Data Science
View GitHub Profile
@ishan-marikar
ishan-marikar / GetScreenshot.bat
Created February 1, 2015 11:53
Capturing screenshots on Android using ADB
@echo off
@echo [*] Waiting for device..
adb wait-for-device
@echo [*] Capturing screenshot and saving temporarily to sd-card..
adb shell screencap -p /sdcard/screen.png
@echo [*] Pulling screenshot off of sd-card..
adb pull /sdcard/screen.png
@echo [*] Removing temporary file on phone
adb shell rm /sdcard/screen.png
@echo [*] Opening screenshot..
@ishan-marikar
ishan-marikar / sri-lankan-districts.json
Last active August 29, 2015 14:14
Sri Lankan Districts with Province (and population)
{
"district": {
"Ampara": {
"province": "Eastern",
"population": {
"2012": 648057
}
},
"Anuradhapura": {
"province": "North Central",
iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
$env:Path +=";" + $env:systemdrive + "\chocolatey\bin"
cwindowsfeatures MSMQ-Server
cinst git.commandline
$env:Path +=";" + $env:systemdrive + "\git\bin"
cinst git-credential-winstore
git config --global core.autocrlf input
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin
Install-WindowsUpdate -AcceptEula
Update-ExecutionPolicy Unrestricted
Set-ExplorerOptions -showHidenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
Set-TaskbarSmall
Enable-RemoteDesktop
cinst TelnetClient -source windowsFeatures
cinst 7zip -force
cinst 7zip.commandline
cinst 7zip.install -force
@ishan-marikar
ishan-marikar / ConEmu.xml
Created February 3, 2015 19:51
My ConEmu backup
<?xml version="1.0" encoding="utf-8"?>
<key name="Software">
<key name="ConEmu">
<key name=".Vanilla" modified="2015-02-04 01:05:57" build="150128">
<value name="SingleInstance" type="hex" data="00"/>
<value name="KeyboardHooks" type="hex" data="01"/>
<value name="UseInjects" type="hex" data="01"/>
<value name="Update.CheckOnStartup" type="hex" data="00"/>
<value name="Update.CheckHourly" type="hex" data="00"/>
<value name="Update.ConfirmDownload" type="hex" data="01"/>

This is a markdown file

A very pretty markdown file.

.. with unordered lists:

  • Hello
  • I am
  • a list

.. and ordered lists:

  1. Yaay! More lists!
SELECT word FROM ts_stat('
SELECT to_tsvector(''english'', message)
FROM backlog
WHERE bufferid = 14'
)
WHERE char_length(word) >= 2
ORDER BY nentry DESC, ndoc DESC, word
LIMIT 10;
<?php
# Nginx don't have PATH_INFO
if (!isset($_SERVER['PATH_INFO'])) {
$_SERVER['PATH_INFO'] = substr($_SERVER["ORIG_SCRIPT_FILENAME"], strlen($_SERVER["SCRIPT_FILENAME"]));
}
$request = substr($_SERVER['PATH_INFO'], 1);
$file = $request;
$fp = @fopen($file, 'rb');
@ishan-marikar
ishan-marikar / cs.py
Last active August 29, 2015 14:20 — forked from myano/cs.py
#!/usr/bin/env python
import curses
import curses.textpad
import time
stdscr = curses.initscr()
#curses.noecho()
#curses.echo()
import requests
from bs4 import BeautifulSoup
import collections
import urlparse
def get_last_record_number(parsed_html):
try:
stuff = parsed_html.find('a', {'title':'End'})
link = stuff.get('href')
parsed = urlparse.urlparse(link)