Skip to content

Instantly share code, notes, and snippets.

View aL3xa's full-sized avatar

Aleksandar Blagotić aL3xa

View GitHub Profile
@aL3xa
aL3xa / imgur.sh
Created April 25, 2012 19:53
Imgur uploader
#! /bin/sh
TEXT=$(curl -F "image"=@"$1" -F "key"="a3793a1cce95f32435bb002b92e0fa5e" http://imgur.com/api/upload.xml | sed -e "s/.*<imgur_page>//" | sed -e "s/<.*//")
echo $TEXT | xclip -selection clipboard
notify-send "Image successfully uploaded to imgur"
return 0
@aL3xa
aL3xa / PKGBUILD
Created November 21, 2012 01:51
RApache github PKGBUILD
# Maintainer: Aleksandar Blagotić <aca.blagotic_at_gmail.com>
# Based on work by: Florian Breitwieser <florian.bw_at_gmail.com>
pkgname=rapache-git
pkgver=20121121
pkgrel=1
pkgdesc="R embedded inside Apache"
arch=('i686' 'x86_64')
url="https://github.com/jeffreyhorner/rapache"
license=('Apache License Version 2.0')
@aL3xa
aL3xa / mooifier.R
Last active December 10, 2015 15:38
Simple and pointless demonstration of R system call output manipulation
#!/usr/bin/Rscript --vanilla
## grab arguments from command line
args <- commandArgs(TRUE)
## replace all argument values with "moo"
s <- sapply(nchar(args) - 1, function(times) paste0("m", paste0(rep("o", times), collapse = "")))
## execute a system cmd (cowsay)
cs <- system2("cowsay", s, stdout = TRUE)
<html>
<head>
<title></title>
<script type="text/javascript" src="http://cdn.rapporter.net/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="/home/al3xa/packages/javascript/Parsley.js/parsley.js"></script>
</head>
<body>
<form method="GET" id="my_form">
<label for="name">Name</label>
<input type="text" id="name" name="name" value="" data-required="true" />
@aL3xa
aL3xa / sweave.sh
Created July 26, 2013 18:29
Sweave script inspired by Dirk Eddelbuettel's answer on StackOverflow: http://stackoverflow.com/questions/2940756/ess-auctex-sweave-integration
#!/bin/bash
FILEBASE=${1%.*}
FILEXT=${1##*.}
FILEPATH=${1%/*}
TEXFILE=$FILEBASE.tex
PDFFILE=$FILEBASE.pdf
# errorexit
function foo(){
return typeof null === 'undefined';
}
for (var i=0; i<10000; ++i) console.log(foo());