Skip to content

Instantly share code, notes, and snippets.

View daroczig's full-sized avatar

Gergely Daróczi daroczig

View GitHub Profile
@atajti
atajti / csalasdetektalas.R
Created March 29, 2017 13:48
Csalásdetektálás az Andego-nál | BURN meetup 2017.03.29.
#-------------------------------------------------------------------#
### Csalásdetektálás - gépjárműbiztosítás ###########################
### BURN meetup 2017.03.29 ###########################
#-------------------------------------------------------------------#
# szükséges csomagok:
# data.table
# stringr
# igraph
@domenic
domenic / redirecting-github-pages.md
Created February 10, 2017 19:28
Redirecting GitHub pages after a repository move

Redirecting GitHub Pages after a repository move

The problem

You have a repository, call it alice/repo. You would like to transfer it to the user bob, so it will become bob/repo.

However, you make heavy use of the GitHub Pages feature, so that people are often accessing https://alice.github.io/repo/. GitHub will helpfully redirect all of your repository stuff hosted on github.com after the move, but will not redirect the GitHub Pages hosted on github.io.

The solution

@wico
wico / Dockerfile
Created June 9, 2016 07:32
Dockerfile to build lampe
FROM ubuntu:15.10
RUN apt-get clean && \
apt-get update && \
apt-get -y install \
libsoup2.4-dev \
libgtk-3-dev \
libjson-glib-dev \
valac \
make \
@Faheetah
Faheetah / Jenkinsfile.groovy
Last active April 25, 2025 15:35
Jenkinsfile idiosynchrasies with escaping and quotes
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"
@jonocarroll
jonocarroll / simplystats_thanksgiving.R
Last active December 1, 2015 05:48
SimplyStats thanksgiving Rubik's Cube solution
## transform the input to the output using rubiks-cube transformations and dplyr
require(dplyr)
## provided input
input <- data.frame(matrix(c("h","a","t","t","i","v","i","g","k","s","g","n","n","g","n","i"),
4,
4,
byrow=TRUE,
dimnames=list(NULL,paste0("col",1:4))),
stringsAsFactors=FALSE)
msg <- function(..., prob = 0.25) {
if (runif(1) > prob) {
return(invisible())
}
messages <- c(...)
message(sample(messages, 1))
}
encourage <- function() {
@dmarcelinobr
dmarcelinobr / President's_height.R
Last active January 4, 2016 22:56
height of president divided by height of most successful opponent. Data from Stulp et al. 2013's paper.
height_ratio <- c(0.924324324, 1.081871345, 1, 0.971098266, 1.029761905,
0.935135135, 0.994252874, 0.908163265, 1.045714286, 1.18404908,
1.115606936, 0.971910112, 0.97752809, 0.978609626, 1,
0.933333333, 1.071428571, 0.944444444, 0.944444444, 1.017142857,
1.011111111, 1.011235955, 1.011235955, 1.089285714, 0.988888889,
1.011111111, 1.032967033, 1.044444444, 1, 1.086705202,
1.011560694, 1.005617978, 1.005617978, 1.005494505, 1.072222222,
1.011111111, 0.983783784, 0.967213115, 1.04519774, 1.027777778,
1.086705202, 1, 1.005347594, 0.983783784, 0.943005181, 1.057142857)
@hyOzd
hyOzd / delete-file-and-buffer.el
Created July 21, 2015 11:55
emacs delete current file and close the buffer
;; based on http://emacsredux.com/blog/2013/04/03/delete-file-and-buffer/
(defun delete-file-and-buffer ()
"Kill the current buffer and deletes the file it is visiting."
(interactive)
(let ((filename (buffer-file-name)))
(if filename
(if (y-or-n-p (concat "Do you really want to delete file " filename " ?"))
(progn
(delete-file filename)
(message "Deleted file %s." filename)
@jeroen
jeroen / readme.md
Last active January 17, 2017 17:21
Testing R packages on Solaris
@JoshData
JoshData / build_logins.sh
Last active November 26, 2020 17:59
rstudio multi-user helper
#!/bin/bash
# Start an AWS instance with one of the AMIs provided by:
# http://www.louisaslett.com/RStudio_AMI/
#
# Get this script.
# wget https://gist.githubusercontent.com/JoshData/615aa18cecb8a6596f59/raw/1b43765552862af98cb16d95dd236a81f6c5b464/build_logins.sh
# chmod +x build_logins.sh
#
# Then use this script to create many logins on the system.