Skip to content

Instantly share code, notes, and snippets.

View relrod's full-sized avatar

Rick Elrod relrod

View GitHub Profile
@relrod
relrod / .gitignore
Last active December 31, 2015 09:19
Haskell program that uses Selenium to check which semesters have grades posted for them on the MyYSU portal.
dist
cabal-dev
*.o
*.hi
*.chi
*.chs.h
.virtualenv
.hsenv
.cabal-sandbox/
cabal.sandbox.config
@relrod
relrod / gist:7585908
Created November 21, 2013 17:26
Cloudflare is very annoying.
ricky@monadic ~$ curl -svo /dev/null -H 'User-Agent: Java/1.7.0_45' https://coinbase.com/api/v1/prices/spot_rate?currency=USD 2>&1 | grep '< HTTP'
< HTTP/1.1 403 Forbidden
ricky@monadic ~$ curl -svo /dev/null -H 'User-Agent: lalala' https://coinbase.com/api/v1/prices/spot_rate?currency=USD 2>&1 | grep '< HTTP'
< HTTP/1.1 200 OK
@relrod
relrod / gist:7532036
Created November 18, 2013 17:43
Useful bash aliases/functions for Fedora contributors and packagers.
# Find packages that you own (or co-own) which are not listed on
# the "Upstream release monitoring" page.
function unmonpkgs {
username="codeblock"
f=`mktemp`
curl -so $f "https://fedoraproject.org/wiki/Upstream_release_monitoring"
for i in `pkgdb-cli list --user "$username" | head -n -1 | awk "{print \\\$1}"`; do
grep "\* $i " $f >/dev/null || echo "Not found: $i"
done
rm $f
@relrod
relrod / gist:6877980
Created October 8, 2013 01:27
polymorphic id in c++
#include <iostream>
template <class foo>
foo id(foo x) { return x; }
int main() {
std::cout << id(123) << std::endl;
}
select persons.nickname, count(assertions.*) as assertions from assertions join persons on assertions.person_id = persons.id group by persons.nickname order by assertions desc limit 10;
VALID: ./_tools/validation/../../_site/news/index.html
INVALID: ./_tools/validation/../../_site/news/2013/03/13/release-notes-v2.10.1.html
INVALID: ./_tools/validation/../../_site/news/2013/03/20/gsoc13.html
VALID: ./_tools/validation/../../_site/news/2013/03/12/scala-days-4.html
INVALID: ./_tools/validation/../../_site/news/2013/03/06/release-notes-v2.10.1-RC3.html
VALID: ./_tools/validation/../../_site/news/2013/04/11/philip-wadler-sw13.html
VALID: ./_tools/validation/../../_site/news/2013/04/11/student-talks-sw13.html
VALID: ./_tools/validation/../../_site/news/2013/07/11/release-notes-v2.11.0-M4.html
INVALID: ./_tools/validation/../../_site/news/2013/02/28/release-notes-v2.9.3.html
INVALID: ./_tools/validation/../../_site/news/2013/02/28/release-notes-v2.10.1-RC2.html
$ repoquery --whatrequires ghc-haskeline
Agda-0:2.3.0.1-6.fc19.x86_64
darcs-0:2.8.3-2.fc19.x86_64
ghc-Agda-0:2.3.0.1-10.fc19.x86_64
ghc-darcs-0:2.8.3-2.fc19.x86_64
ghc-haskeline-devel-0:0.6.4.7-5.fc19.x86_64
ghc-hledger-0:0.17-4.fc19.x86_64
hledger-0:0.17-4.fc19.x86_64

Eastern (Specified)

$ http --json http://hrf.cloud.fedoraproject.org/timestamp?timezone=US/Eastern < /tmp/json1
HTTP/1.1 200 OK
Connection: keep-alive
Content-Length: 238
Content-Type: application/json
Date: Wed, 03 Jul 2013 22:36:07 GMT
Server: Apache/2.2.15 (Red Hat)
api_key: "trolololololololol"
sender_id: "troooooooooooooololol"
post_url: "https://android.googleapis.com/gcm/send"
users:
- registration_id: "lololol trololololol"
topics:
- org.fedoraproject.prod.git.receive
- org.fedoraproject.prod.bodhi.buildroot_override.tag
- org.fedoraproject.prod.buildsys.build.state.change
- org.fedoraproject.prod.planet.post.new