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
# brew install phantomjs | |
# pip install selenium | |
import re | |
from selenium import webdriver | |
url = 'http://www.ncbi.nlm.nih.gov/pubmed/17708774' | |
driver = webdriver.PhantomJS() | |
driver.get(url) |
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
from itertools import groupby | |
def fn(s): | |
if not s: | |
return '1' | |
return ''.join('{}{}'.format(n, len(tuple(_iter))) for n, _iter in groupby(s)) | |
s = '' | |
for i in range(10): | |
s = fn(s) |
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
0 1 2 3 4 5 6 7 8 9 | |
29 30 31 32 33 34 35 36 37 10 | |
28 51 52 53 54 55 56 57 38 11 | |
27 50 65 66 67 68 69 58 39 12 | |
26 49 64 63 62 61 60 59 40 13 | |
25 48 47 46 45 44 43 42 41 14 | |
24 23 22 21 20 19 18 17 16 15 |
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 android.content.Context; | |
import android.graphics.Typeface; | |
import android.util.AttributeSet; | |
import android.widget.TextView; | |
public class AwesomeTextView extends TextView { | |
public AwesomeTextView(Context context) { | |
super(context); | |
setFont(); | |
} |
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 android.support.v7.widget.ShareActionProvider; | |
@Override | |
public boolean onCreateOptionsMenu(Menu menu) { | |
// Inflate the menu; this adds items to the action bar if it is present. | |
getMenuInflater().inflate(R.menu.menu_main, menu); | |
MenuItem menuItem = menu.findItem(R.id.action_share); | |
ShareActionProvider actionProvider = (ShareActionProvider) MenuItemCompat.getActionProvider(menuItem); | |
actionProvider.setShareHistoryFileName(ShareActionProvider.DEFAULT_SHARE_HISTORY_FILE_NAME); |
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
package com.sunkist.udacity20141225; | |
import android.database.Cursor; | |
import android.provider.ContactsContract; | |
import android.support.v4.content.CursorLoader; | |
import android.support.v4.content.Loader; | |
import android.support.v7.app.ActionBarActivity; | |
import android.support.v4.app.Fragment; | |
import android.os.Bundle; | |
import android.util.Log; |
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
#!/bin/sh | |
find . -type f -name "*.png" -exec convert {} -strip {} \; |
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
.copy-banner { | |
background-color: #00733a; | |
} | |
h1, h1 a:visited, | |
h2, h2 a:visited, | |
h3, h3 a:visited, | |
h4, h4 a:visited, | |
h5, h5 a:visited, | |
h6, h6 a:visited { |
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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Google Map with Spreadsheet</title> | |
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> | |
<style>body { padding-top: 90px; padding-bottom: 90px; } ul { margin: 0; padding: 0; } li { list-style: none;} table thead th { text-align: center; } form label { font-size: 1.2em; }</style> | |
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootswatch/3.1.1/journal/bootstrap.min.css" /> | |
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css" /> | |
<style type="text/css"> |
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
#!/usr/bin/env python2 | |
# coding: utf-8 | |
from __future__ import print_function | |
import sys | |
import re | |
import json | |
import urllib | |
from colorama import init, Fore, Back, Style | |
URL = 'http://csearch.naver.com/dcontent/spellchecker.nhn' |