Skip to content

Instantly share code, notes, and snippets.

View phillipadsmith's full-sized avatar

Phillip Smith phillipadsmith

View GitHub Profile
@tempire
tempire / template_loader.pl
Last active December 26, 2015 04:19
Load templates from __DATA__ @@Sections with replacement
use Modern::Perl;
use Mojo::Template;
use Mojo::Loader;
say Mojo::Template->new->render(Mojo::Loader->new->data(__PACKAGE__, 'hello'),
qw/ glen hinkle /);
__DATA__
@@ hello
% my ($fname, $lname) = @_;
@dhlavaty
dhlavaty / downloadCSV.cs
Last active August 7, 2025 11:01
Download CSV file from Google Spreadsheet (Google Drive) using minimum c# code
using System;
using System.Net;
namespace ConsoleApplication1
{
class Program
{
public class WebClientEx : WebClient
{
public WebClientEx(CookieContainer container)
require 'json'
require 'net/http'
# JSON parser tag, creating map for use in jekyll markdown
# Alex.Heneveld @ Cloudsoft Corp (remove spaces and add the .com)
# Released under APL 2.0
# usage: {% jsonball varname from TYPE PARAM %}
#
# where TYPE is one of {data,var,file,page}, described below
import re
import pandas as pd
import boto.s3
from boto.s3.key import Key
import sys
import os
from selenium import webdriver
from contextlib import closing
from selenium.webdriver.support.ui import WebDriverWait
from selenium.common.exceptions import NoSuchElementException
page = require('webpage').create()
page.onConsoleMessage = (msg) ->
console.log 'CONSOLE:' + msg
page.onResourceRequested = (params, request) ->
isJavaScript = params['url'].slice(-3) is '.js'
isJQuery = (params['url'].indexOf 'jquery') isnt -1
if isJavaScript and not isJQuery

ProPublica News Applications Fellow

We’re looking for the next great News Applications Fellow to work with ProPublica’s world-class news applications desk.

To give you a sense of the work you’ll be doing, here are examples of what your predecessors have done: Our first Fellow built our Nursing Home Inspect app as well as the Pipeline Tracker, which is as far as we know the first news application and reported story that share a single byline. The second Fellow helped build Free the Files, one of the most ambitious journalistic crowdsourcing projects ever, and completely revamped our hugely popular [Dollars

@afragen
afragen / iOS-aspect-ratio.css
Created May 21, 2013 23:45
iOS media queries - device aspect ratio
/*Another useful media feature is device-aspect-ratio.*/
/*Note that the iPhone 5 does not have a 16:9 aspect ratio. It is in fact 40:71.*/
/*iPhone < 5:*/
@media screen and (device-aspect-ratio: 2/3) {}
/*iPhone 5:*/
@media screen and (device-aspect-ratio: 40/71) {}
require 'sinatra'
require 'sanitize'
TO_REMOVE = ["", " ", "&nbsp;"]
get '/' do
<<-HTML
<form method="post" action="sanitize">
<textarea name="dirty" style="width:100%;height:800px;"></textarea>
<input type="submit" value="Submit">
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Stripe Getting Started Form</title>
<!-- The required Stripe lib -->
<script type="text/javascript" src="https://js.stripe.com/v1/"></script>
<!-- jQuery is used only for this example; it isn't required to use Stripe -->
package Mojolicious::Plugin::Pipeline::CSSCompressor;
use Mojo::Base 'Mojolicious::Plugin';
use CSS::Compressor 'css_compress';
sub register {
my ($self, $app) = @_;
# Register "css_compressor" filter
$app->filter(css_compressor => sub { css_compress shift });