Skip to content

Instantly share code, notes, and snippets.

James Dennes jdennes

Block or report user

Report or block jdennes

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jdennes
jdennes / get-site-admin-report.sh
Last active Feb 27, 2019
Shell script to get Site Admin reports on GitHub Enterprise
View get-site-admin-report.sh
#!/bin/bash
# Export USERNAME, PASSWORD, and REPORT_URL
# REPORT_URL should look something like https://my.ghe/stafftools/reports/all_users.csv
# See: https://help.github.com/enterprise/admin/articles/site-admin-dashboard/#reports
set -e
for i in $(seq 1 5); do
echo "Trying to get report..."
result=$(curl -s -L -u $USERNAME:$PASSWORD $REPORT_URL)
@jdennes
jdennes / README.md
Last active Oct 16, 2016
Convert a directory of .ogg files to .mp3 files
View README.md
  • You need ffmpeg installed. If you have Homebrew installed on a Mac, you can do this by running:

    brew install ffmpeg
    
  • Put process.sh in directory containing .ogg files.

  • Ensure it's executable:

@jdennes
jdennes / buienradar-sparkline
Last active Apr 29, 2016
Example of how to pipe output from `script/scrape` provided by https://github.com/jdennes/buienalarm into `spark`
View buienradar-sparkline
$ script/scrape enschede
===> Scraping Buienalarm.nl...
Projected rainfall for the next two hours in enschede:
18:40 - 0.05mm/hour (light)
18:45 - 0.05mm/hour (light)
18:50 - 0.09mm/hour (light)
18:55 - 0.11mm/hour (light)
19:00 - 0.13mm/hour (light)
@jdennes
jdennes / buienalarm-scraper-details.md
Last active May 6, 2019
Documents how to scrape Buienalarm.nl (until their website changes)
View buienalarm-scraper-details.md

Buienalarm.nl scraper details

A request to http://www.buienalarm.nl/location/rotterdam produces a chart that shows the projected rainfall for the next two hours in Rotterdam:

buienalarm

That page includes the following JavaScript that represents the data used to build the chart:

<script type="text/javascript">
View keybase.md

Keybase proof

I hereby claim:

  • I am jdennes on github.
  • I am jdennes (https://keybase.io/jdennes) on keybase.
  • I have a public key whose fingerprint is 9886 E863 A016 9D16 D60D 5B27 0078 B621 0DD0 ABB1

To claim this, I am signing this object:

@jdennes
jdennes / Gemfile
Last active Feb 18, 2020
Export a list of members from a GitHub organisation
View Gemfile
source "https://rubygems.org"
gem "octokit"
@jdennes
jdennes / link-header.sh
Last active Dec 26, 2015
Demonstrate repository url by ID included in the pagination details in the Link header.
View link-header.sh
@jdennes
jdennes / request.sh
Last active Dec 31, 2019
Most starred public repositories on GitHub.
View request.sh
curl -G https://api.github.com/search/repositories \
--data-urlencode "q=stars:>1000" \
--data-urlencode "sort=stars" \
--data-urlencode "order=desc" \
-H "Accept: application/vnd.github.preview"
@jdennes
jdennes / CreateSendOAuthTest.java
Last active Dec 14, 2015
A Java application to demonstrate authenticating with the Campaign Monitor API using OAuth. Uses the createsend-java library as well as the Spark micro web framework (but could easily be adapted for use with any Java web application framework).
View CreateSendOAuthTest.java
// Ensure you set the CREATESEND_CLIENT_ID, CREATESEND_CLIENT_SECRET,
// and CREATESEND_REDIRECT_URI environment variables for your registered
// OAuth application.
import static spark.Spark.*;
import spark.*;
import com.createsend.General;
import com.createsend.models.clients.ClientBasics;
import com.createsend.models.OAuthTokenDetails;
import com.createsend.util.AuthenticationDetails;
@jdennes
jdennes / createsend-oauth.php
Last active Dec 13, 2015
A PHP application to demonstrate authenticating with the Campaign Monitor API using OAuth. Uses the createsend-php library as well as the Slim PHP micro framework (but could easily be adapted for use with any PHP framework).
View createsend-oauth.php
<?php
# 1. Ensure you have Slim installed and in your include path.
# 2. Ensure you have createsend-php installed and in your include path.
# 3. Set CREATESEND_CLIENT_ID, CREATESEND_CLIENT_SECRET,
# and CREATESEND_REDIRECT_URI environment variables for
# your registered OAuth application.
require 'createsend/csrest_general.php';
require 'Slim/Slim.php';
\Slim\Slim::registerAutoloader();
You can’t perform that action at this time.