Skip to content

Instantly share code, notes, and snippets.

View daroczig's full-sized avatar

Gergely Daróczi daroczig

View GitHub Profile
@bpartridge83
bpartridge83 / Fix for Adobe Flash Player Settings Click issues in Chrome
Created August 15, 2012 20:59
The reason that the settings panel won't accept clicks is because the Flash element is positioned at a calculated partial-pixel, due to the margin-top property of 10%.
setTimeout(function(){
var $div = $('div:last'),
marginTop = parseFloat($div.css('margin-top'));
$div.css({
'margin-top' : Math.round(marginTop)
});
}, 250);
@pkhamre
pkhamre / README.md
Created September 13, 2012 12:02
Pingdom maintenance window

Pingdom maintenance window

A simple ruby-script which uses em-http-request to send an API request to the Pingdom API to pause or unpause all checks.

@n1k0
n1k0 / Howto.md
Created October 1, 2012 17:59
CasperJS test cli hooks example

Put test1.js and test2.js into a tests/ directory, then run the suite:

$ casperjs test tests/ --pre=pre.js --includes=inc.js --post=post.js
Test file: /Users/nperriault/tmp/pre-inc/pre.js                                 
Hey, I'm executed before the suite.
Test file: /Users/nperriault/tmp/pre-inc/tests/test1.js                         
# this is test 1
Hi, I've been included.
PASS Subject is strictly true
@dsparks
dsparks / voronoi_raster.R
Created October 30, 2012 15:41
Image Manipulation, Part 3
doInstall <- TRUE # Change to FALSE if you don't want packages installed.
toInstall <- c("ReadImages", "reshape", "ggplot2")
if(doInstall){install.packages(toInstall, repos = "http://cran.r-project.org")}
lapply(toInstall, library, character.only = TRUE)
# Image URL:
allImageURLs <- c("http://media.charlesleifer.com/blog/photos/thumbnails/akira_940x700.jpg",
"http://upload.wikimedia.org/wikipedia/commons/thumb/e/ec/Mona_Lisa%2C_by_Leonardo_da_Vinci%2C_from_C2RMF_retouched.jpg/402px-Mona_Lisa%2C_by_Leonardo_da_Vinci%2C_from_C2RMF_retouched.jpg",
"http://upload.wikimedia.org/wikipedia/commons/thumb/e/e9/Official_portrait_of_Barack_Obama.jpg/441px-Official_portrait_of_Barack_Obama.jpg",
"http://cache.boston.com/universal/site_graphics/blogs/bigpicture/obama_11_05/obama22_16604051.jpg",
@alphazo
alphazo / .gitignore
Last active October 12, 2015 21:39
ArchLinux Installation Guide - Encrypted SSD (GPT/GRUB2/LUKS/LVM/Systemd)
*.*~
@cdesante
cdesante / happythanksgiving.r
Created November 21, 2012 01:22
Thanksgiving
toInstall <- c("ggplot2")
if(doInstall){install.packages(toInstall, repos = "http://cran.r-project.org")}
lapply(toInstall, library, character.only = TRUE)
library(ggplot2)
Turkey <- read.csv("http://www.oberlin.edu/faculty/cdesante/assets/downloads/turkey.csv")
ggplot(data = Turkey) + geom_tile(aes(x = Happy, y = Thanksgiving, fill=Turkey.Colors,
width=1))+ scale_fill_identity() + theme_bw()
@wch
wch / app.r
Last active December 18, 2023 16:41
Shiny example app with dynamic number of plots
max_plots <- 5
ui <- fluidPage(
headerPanel("Dynamic number of plots"),
sidebarPanel(
sliderInput("n", "Number of plots", value=1, min=1, max=5)
),
@hadley
hadley / .gitignore
Last active February 25, 2024 02:10
Benchmark different ways of reading a file
.Rproj.user
.Rhistory
.RData
*.Rproj
*.html
@ramnathv
ramnathv / code.R
Created October 9, 2013 02:53
Funnel Chart with rCharts and Highcharts
# install from html_assets branch
# install_github("rCharts", "ramnathv", ref = "html_assets")
# utility function to convert data frame to format required for funnel
make_dataset = function(x, y, data){
require(rCharts)
toJSONArray2(data[c(x, y)], json = F, names = F)
}
options(stringsAsFactors = F)
@amoeba
amoeba / anscombe-ggplot.r
Last active October 6, 2019 08:57
Anscombe's Quartet with ggplot2
library(ggplot2)
theme_set(theme_bw(base_size=18))
anscombe_m <- data.frame()
for(i in 1:4)
anscombe_m <- rbind(anscombe_m, data.frame(set=i, x=anscombe[,i], y=anscombe[,i+4]))
ggplot(anscombe_m, aes(x, y)) + geom_point(size=5, color="red", fill="orange", shape=21) + geom_smooth(method="lm", fill=NA, fullrange=TRUE) + facet_wrap(~set, ncol=2)