Skip to content

Instantly share code, notes, and snippets.

View ndarville's full-sized avatar

N. Darville ndarville

  • Europe
View GitHub Profile
@eikes
eikes / hnpolls.js
Created October 23, 2011 20:18
Hacker News Polls Visualisation JavaScript Bookmarklet
javascript:(function(){
var s = document.createElement("script");
s.setAttribute("src", "http://code.jquery.com/jquery.js");
document.body.appendChild(s);
s.addEventListener("load", function() {
var $ = jQuery;
var max = 0;
var table = "table tr:eq(3) table:eq(1) ";
$(table).width("100%");
$(table + "tr td:eq(0)").width("15px");
// ==UserScript==
// @name Show Full Domain on Hacker News posts
// @description Sets full domain on hacker news posts.
// @namespace http://userscripts.org/users/119115
// @include http://news.ycombinator.com/*
// @include https://news.ycombinator.com/*
// @match https://news.ycombinator.com/*
// @match http://news.ycombinator.com/*
// ==/UserScript==
diff --git a/iPhoneTrackingAppDelegate.m b/iPhoneTrackingAppDelegate.m
index 1d22ecb..4af2bcf 100644
--- a/iPhoneTrackingAppDelegate.m
+++ b/iPhoneTrackingAppDelegate.m
@@ -146,7 +146,7 @@
return NO;
}
- const float precision = 100;
+ const float precision = 10000;
@ascheink
ascheink / gitmo-splash.rb
Last active December 13, 2015 20:08
Code to quickly create a mosaic image of the faces of the detainees still in Gitmo http://i.imgur.com/tIqdGtH.jpg
require 'nokogiri'
require 'httparty'
puts "Scraping ids of detainees in custody"
ids = []
(1..10).each do |n|
response = HTTParty.get "http://projects.nytimes.com/guantanamo/detainees/held?page=#{n}"
page = Nokogiri::HTML(response)
ids += page.css('#detaineesTable a').map { |link| $1 if /detainees\/(\d+)/ =~ link['href'] }.compact
end
@mattyoho
mattyoho / ios-test.css
Created October 19, 2011 19:12 — forked from tonywok/ios-test.css
iOS Media Queries
// iOS Media Queries
// Goal: capture styles for iPhone, iPhone 3G, iPhone 3GS, iPhone 4, iPhone 4S, iPad, and iPad 2
//
// Author: Tony Schneider (@tonywok)
// Please tell me where I fail. :)
// iPhone v(4,4S) portrait
// test: black text (overwritten by v* portrait) with blue background
@media all and (-webkit-min-device-pixel-ratio: 2) and (orientation: portrait) {
a {
@mmaelzer
mmaelzer / 538.sh
Last active October 18, 2016 04:07
Bash script to fetch latest polls-only forecast from fivethirtyeight.com. Defaults to US but allows an optional state argument.
#!/bin/bash
# Fetches data from http://projects.fivethirtyeight.com/2016-election-forecast/summary.json,
# parses the results using python, and prints the polls-only forecast results in the format:
# "{STATE} D {PROBABILITY} R {PROBABILITY}"
#
# The script takes an optional argument that specifies an individual two letter abbreviation (case insensitive)
# of a U.S. state. By default, the state is US which returns the national results.
#
# Examples:
@mheffner
mheffner / README.md
Created October 3, 2012 18:11
Upload Travis CI builds to S3

Upload Travis CI builds to S3

This will demonstrate how to upload build files from Travis CI to S3.

NOTE: Keys have been changed to protect the innocent.

Step 1: Create an S3 policy.

Create an S3 ACL policy, see s3_policy.json for an example.

@noibl
noibl / hn-betteridge.user.js
Created June 11, 2012 04:55
Betteridge's Law for Hacker News
// ==UserScript==
// @name BetteridgeLinks
// @description Lowlight headlines on Hacker News that conform to Betteridge's Law
// @version 0.3
// @match http://news.ycombinator.com/*
// @author noibl <pjpee6w5pc@snkmail.com>
// ==/UserScript==
var questions = ['Is', 'Are', 'Does', 'Do', 'Has', 'Have', 'Did', 'Will', 'Can', 'Could', 'Should'];
var selector = '.title a';
@nolanlawson
nolanlawson / mastodon-frontend-perf-suggestions.md
Last active April 29, 2017 13:05
Mastodon frontend perf suggestions

Mastodon frontend perf suggestions

I took some time this weekend to analyze Mastodon's frontend performance. I didn't manage to write many fixes (just a config fix and better caching for static assets) so this was mostly just investigation.

The point of this document is to lay out some of my initial thoughts, since it may be helpful for others. There's a lot of technical jargon, so you may want to get some background by looking at my blog post on "The cost of small modules" and my talk on "Solving the web performance crisis" (slides).

Tootstorms

@Psycojoker
Psycojoker / a.md
Last active October 10, 2017 17:51
Github's pages targeted by porn industry DMCA request to google

Apparently the porn industry is going after github pages (by sending DMCA to google), you can read the story here (found there).

Using https://www.chillingeffects.org/notices/search?page=1&sort_by=&term=github.com (https://github.com/berkmancenter/chillingeffects/blob/master/doc/api_documentation.mkd#example-successful-response-2) (and an horribly quick and dirty script), here is the list all the concerned users and repositories page (you can find the data bellow):

Users pages