This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Jekyll | |
class CatIndex < Page | |
def initialize(site, base, dir, cat) | |
@site = site | |
@base = base | |
@dir = dir | |
@name = 'index.html' | |
self.process(@name) | |
self.read_yaml(File.join(base, '_layouts'), 'cat_index.html') | |
self.data['cat'] = cat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.highlight { background: #1e2426; color: #babdb6} | |
.highlight .hll { background-color: #ffffcc } | |
.highlight .c { color: #656763} /* Comment */ | |
.highlight .err { color: #babdb6} /* Error */ | |
.highlight .g { color: #babdb6} /* Generic */ | |
.highlight .k { color: #729fcf} /* Keyword */ | |
.highlight .l { color: #babdb6} /* Literal */ | |
.highlight .n { color: #babdb6} /* Name */ | |
.highlight .o { color: #babdb6} /* Operator */ | |
.highlight .x { color: #babdb6} /* Other */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import xml.etree.ElementTree as etree | |
ns = {'wp': 'http://wordpress.org/export/1.2/', 'content': 'http://purl.org/rss/1.0/modules/content/'} | |
blog = etree.parse('data.xml').getroot().find('channel') | |
for item in blog.findall('item'): | |
header = [] | |
title = item.find('title').text | |
slug = item.find('wp:post_name', ns).text | |
content = item.find('content:encoded', ns).text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Keepvid video downloader by ongspxm | |
This script uses keepvid to download videos from streaming sites (youtube, etc). Currently, it is set to download 480p quality videos. Edit to fit your needs. | |
The links are to be entered in this format: | |
[name of file w/o extension] [link to video] | |
To automate the process, you can combine all of the links into a list. Then you can run the script in the following manner: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var label = 'schedule'; | |
function dpad(num){ | |
if(num<10){ | |
return "0"+num; | |
}else{ | |
return num; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n, m = map(int, raw_input().split()) | |
grid = [] | |
for i in range(n): | |
grid.append(map(int, raw_input().split())) | |
dp = [] | |
for i in range(n): | |
dp.append([0]*m) | |
for i in range(n): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "stdio.h" | |
void postorder(int idx, int vals[], int left[], int right[]){ | |
if(left[idx]>-1){ postorder(left[idx], vals, left, right); } | |
if(right[idx]>-1){ postorder(right[idx], vals, left, right); } | |
printf("%d ", vals[idx]); | |
} | |
int main(void){ | |
int n; scanf("%d", &n); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Colorscheme | |
colorscheme desert | |
syntax on | |
" Spaces & Tabs | |
set tabstop=4 shiftwidth=4 softtabstop=4 expandtab | |
set autoindent | |
retab | |
" Wrapping |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
class Solution{ | |
void run(){ | |
Scanner cin = new Scanner(System.in); | |
int T = cin.nextInt(); | |
for(int t=0; t<T; t++){ | |
int N = cin.nextInt(), | |
K = cin.nextInt(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
class Solution{ | |
boolean allDone(boolean[][] grid, int c){ | |
for(int i=0; i<3; i++){ | |
for(int j=0; j<3; j++){ | |
if(!grid[i][c+j]) return false; | |
} | |
} |