Skip to content

Instantly share code, notes, and snippets.

View frhd's full-sized avatar
🏠
Working from home

farhad frhd

🏠
Working from home
  • quantyc
  • Göttingen, Germany
  • 20:16 (UTC +02:00)
  • X @frhd27
View GitHub Profile
#! /usr/bin/env python2
# Requires: PIL, colormath
#
# Improved algorithm now automatically crops the image and uses much
# better color matching
from PIL import Image, ImageChops
from colormath.color_objects import RGBColor
import argparse
import math

Backstory: I decided to crowdsource static site generator recommendations, so the following are actual real world suggested-to-me results. I then took those and sorted them by language/server and, just for a decent relative metric, their Github Watcher count. If you want a heap of other projects (including other languages like Haskell and Python) Nanoc has the mother of all site generator lists. If you recommend another one, by all means add a comment.

Ruby

'use strict';
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
docpad: {
files: [ "./src/**/*.*" ],
out: ["out"]
},
watch: {

steps to reproduce:

curl 'http://thequeue.org/cr?id=https%3A%2F%2Faaronsw.jottit.com%2Fhowtoget&title=Aaron%20Swartz:%20howtoget' > how-to-get.html
html2text.py how-to-get.html > how-to-get.md
gist < how-to-get.md

Aaron Swartz: howtoget

@frhd
frhd / readme.md
Last active August 29, 2015 14:27 — forked from coolaj86/how-to-publish-to-npm.md
How to publish packages to NPM

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser

@frhd
frhd / jsf.md
Created March 2, 2016 10:56 — forked from nekman/jsf.md
Don't use JSF

JSF?!

http://www.thoughtworks.com/radar/#/languages-and-frameworks/683 - ThoughtWorks Technology Radar - January 2014

We continue to see teams run into trouble using JSF -- JavaServer Faces -- and are recommending you avoid this technology. Teams seem to choose JSF because it is a J2EE standard without really evaluating whether the programming model suits them. We think JSF is flawed because it tries to abstract away HTML, CSS and HTTP, exactly the reverse of what modern web frameworks do. JSF, like ASP.NET webforms, attempts to create statefulness on top of the stateless protocol HTTP and ends up causing a whole host of problems involving shared server-side state. We are aware of the improvements in JSF 2.0, but think the model is fundamentally broken. We recommend teams use simple frameworks and embrace and understand web technologies including HTTP, HTML and CSS.


http://www.jfokus.se/jfokus/talks.jsp - Search for JSF... (one hit on why you should leave it)
http://architecture-musings.blo
@frhd
frhd / build.gradle
Created April 20, 2016 13:18 — forked from spikeheap/build.gradle
Gradle build script to install NodeJS packages and Bower dependencies. This assumes you create package.json (nodejs) and bower.json files in the root of your project.
import org.gradle.api.tasks.Exec
defaultTasks 'bower'
// Get the path for the locally installed binaries
task npmBin << {
new ByteArrayOutputStream().withStream { os ->
def result = exec {
executable = 'npm'
args = ['bin']
@frhd
frhd / DropwizardJettyCrossOriginIntegrationTest.java
Created July 7, 2016 09:35 — forked from mrserverless/DropwizardJettyCrossOriginIntegrationTest.java
Dropwizard 0.8.0 and 0.9.0 Jetty CORS Filter with Unit Tests. To prove this works once and for all
import io.dropwizard.Application;
import io.dropwizard.Configuration;
import io.dropwizard.client.JerseyClientBuilder;
import io.dropwizard.setup.Environment;
import io.dropwizard.testing.junit.DropwizardAppRule;
import org.assertj.core.data.MapEntry;
import org.eclipse.jetty.servlets.CrossOriginFilter;
import org.junit.ClassRule;
import org.junit.Test;
@frhd
frhd / readme.md
Created December 21, 2017 00:07 — forked from max-mapper/readme.md
automatically scan for and join open internet enabled wifi networks on linux using node.js (tested on raspberry pi raspbian)
@frhd
frhd / hosts
Created February 24, 2019 17:06 — forked from aparajita/hosts
hosts file entries to block Facebook
# Block facebook!
0.0.0.0 static.ak.fbcdn.net
0.0.0.0 www.connect.facebook.net
0.0.0.0 www.facebook.com
0.0.0.0 www.fbcdn.com
0.0.0.0 www.fbcdn.net
0.0.0.0 www.graph.facebook.com
0.0.0.0 www.login.facebook.com
0.0.0.0 www.s-static.ak.facebook.com
0.0.0.0 www.static.ak.connect.facebook.com