Skip to content

Instantly share code, notes, and snippets.

View pchaigno's full-sized avatar

Paul Chaignon pchaigno

View GitHub Profile
@pchaigno
pchaigno / execution_time.c
Last active August 29, 2015 13:57
Execution time computation on yacc
#include <time.h>
clock_t begin, end;
double time_spent;
begin = clock();
yyin=fp;
yyparse();
fclose(fp);

enigma

opts_chunk$set(fig.width=8, fig.pos="h", fig.path="inst/assets/figure/")

Build Status An R client for Enigma.io Enigma holds government data and provides a really nice set of APIs for data, metadata, and stats on each of the datasets. That is, you can request a dataset itself, metadata on the dataset, and summary statistics on the columns of each dataset.

enigma info

enigma
=======
```{r, eval=TRUE, echo=FALSE}
opts_chunk$set(fig.width=8, fig.pos="h", fig.path="inst/assets/figure/")
```
[![Build Status](https://api.travis-ci.org/rOpenGov/enigma.png)](https://travis-ci.org/rOpenGov/enigma)
**An R client for [Enigma.io](https://app.enigma.io/)**

(some of α, ᾱ, β, β̄, γ or γ̄) B̄Ā(). (some of α, ᾱ, β, β̄, γ or γ̄) B̄Ā().

@pchaigno
pchaigno / median-line-length.rb
Created October 6, 2014 02:04
Median line length for minified files
def minified_files?
return unless ['.js', '.css'].include? extname
if lines.any?
median = lines.sort_by { |l| l.length}[lines.length / 2].length
puts "median line length: #{median}\n"
(lines.inject(0) { |n, l| n += l.length } / lines.length) > 110
else
false
end
end
def setup
super
@repo = sandbox_init("testrezpo")
@repo.checkout_tree(@repo.rev_parse("refs/heads/dir"), :strategy => :force)
IO.write(File.join(@repo.workdir, ".gitattributes"), ATTRIBUTES)
end

A super fast, highly extensible markdown parser for PHP

Latest Stable Version Total Downloads Build Status Tested against HHVM Code Coverage Scrutinizer Quality Score

@pchaigno
pchaigno / triage_inc.py
Last active August 29, 2015 14:12
Triage of .inc files on GitHub by languages
#!/usr/bin/env python
import os
import re
re_php = re.compile(r"<\?(php)?\s", re.MULTILINE)
re_clarion = re.compile(r"^([A-Z][a-z]+\s+PROCEDURE\(|![\s\w-]+)", re.MULTILINE)
re_pascal = re.compile(r"^\s*(end;(\s*{[^}]+})?\s*$|{\$\w+\s)", re.MULTILINE | re.IGNORECASE)
re_sourcepawn = re.compile(r"^\s*(native|forward|stock)\s+[\w:]+\s*\(", re.MULTILINE | re.IGNORECASE)
re_cpp = re.compile(r"^\s*#(include|define|if|endif|pragma)\s*", re.MULTILINE)
re_html = re.compile(r"<\/\w+>", re.MULTILINE)
@pchaigno
pchaigno / disjunction.linguist
Created January 4, 2015 12:35
Results from Linguist detection on ArcaneIngenuity/disjunction
78.83% JavaScript
13.20% C
4.92% C++
2.82% CSS
0.23% Shell
C:
c/disjunction.c
c/examples/foundation/src/main.c
c/examples/glfw/src/BasicModel.h