Skip to content

Instantly share code, notes, and snippets.

View sckott's full-sized avatar
😸

Scott Chamberlain sckott

😸
View GitHub Profile
@esperlu
esperlu / mysql2sqlite.sh
Created April 27, 2011 05:46
MySQL to Sqlite converter
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
@g3d
g3d / gist:2709563
Last active February 7, 2024 15:21 — forked from saetia/gist:1623487
Clean Install – OS X 10.11 El Capitan
@djaiss
djaiss / gist:2938259
Created June 15, 2012 19:13
PHP List of countries
<?php
$countries =
array(
"AF" => "Afghanistan",
"AL" => "Albania",
"DZ" => "Algeria",
"AS" => "American Samoa",
"AD" => "Andorra",
"AO" => "Angola",
@i-scorpion
i-scorpion / README.txt
Created June 18, 2012 12:24
Twitter bootstrap fixed table header using jQuery
Here is a simple jQuery plugin to make a table header fixed on top when window is scrolled.
Using the code from twitter bootstrap documentation page, this code is customized for table header.
Create the table with following layout -
<table class="table-fixed-header">
<thead class="header">
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
@sway
sway / fontawesome.sty
Created July 12, 2012 23:14
FontAwesome mapping for XeLaTeX
% FontAwesome (http://fortawesome.github.com/Font-Awesome/) bindings for (Xe)LaTeX
% Author: Honza Ustohal <[email protected]>
%
% Translation of FontAwesome's private range characters into XeTeX symbols. All icons are camel-cased and prefixed with 'fa', i.e. what was .icon-align-center the CSS version of FontAwesome becomes \faAlignCenter
% This might be reworked into a full blown package in the near future
%
% Prerequisite:
% XeLaTeX, FontAwesome installed as a system font accessible by XeLaTeX
%
% Usage:
@jcheng5
jcheng5 / server.R
Created November 10, 2012 08:13
Shiny file upload demo
shinyServer(function(input, output) {
output$filetable <- reactiveTable(function() {
if (is.null(input$files)) {
# User has not uploaded a file yet
return(NULL)
}
input$files
})
})
@tts
tts / gist:4584793
Last active December 11, 2015 10:08
Altmetrics scores by Altmetric and traditional citation metrics (WoS) of Aalto University publications published between 2007 and 2012 and with a DOI known by WoS.
###########################################################
#
# Altmetrics about Aalto University publications
# 2007-2012 with a DOI
#
# Altmetrics data provided by altmetric.com
# Web of Science data provided by Thomson Reuters
#
##########################################################
library(rAltmetric)
@sckott
sckott / d1_blog_aggregator_todo.md
Created May 14, 2013 19:59
To do, D1 data blog aggregator.

Things to do on the blog aggregator

To add

  • bootstrap style alert of where to go for original blog post instead of the defaultl theme thing
  • make categories/tags imports actually work
  • Add more instructions on the add blog page on what is appropriate
  • After we get permanent URL, add in Disqus plugin
@ramnathv
ramnathv / server.R
Created May 25, 2013 17:14
Shiny Tables using hwriter
require(shiny)
require(hwriter)
dat <- read.csv(textConnection("homeTeam, homeScore, awayTeam, awayScore
Boston, 3, NY Rangers, 4
Chicago, 0, Detroit, 2
San Jose, 0, Los Angeles, 3"), header = TRUE)
shinyServer(function(input, output){
output$mytable <- renderText({
@dwillis
dwillis / president.json
Last active December 17, 2015 20:19
OpenElections Results spec example version 2
{
"election_id": "md-2012-11-06-general",
"division": "ocd-division/country:us/state:md",
"office_name": "President",
"office_district": "",
"results": [{"given_name": "Barack", "additional_name": "", "last_name": "Obama", "suffix": "", "name": "Barack Obama", "other_names": [], "party": "DEM", "votes": 1677844, "percent": 61.97, "winner": true},
{"given_name": "Mitt", "additional_name": "", "last_name": "Romney", "suffix": "", "name": "Mitt Romney", "other_names": [], "party": "REP", "votes":971869, "percent": 35.9, "winner": false },
{"given_name": "Gary", "additional_name": "", "last_name": "Johnson", "suffix": "", "name": "Gary Johnson", "other_names": [], "party": "LIB", "votes":30195, "percent": 1.12, "winner": false },
{"given_name": "Jill", "additional_name": "", "last_name": "Stein", "suffix": "", "name": "Jill Stein", "other_names": [], "party": "GRE", "votes":17110, "percent": 0.63, "winner": false },
{"given_name": "", "additional_name": "", "last_name": "Other Write-Ins", "suff