This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function foo(){ | |
return typeof null === 'undefined'; | |
} | |
for (var i=0; i<10000; ++i) console.log(foo()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
FILEBASE=${1%.*} | |
FILEXT=${1##*.} | |
FILEPATH=${1%/*} | |
TEXFILE=$FILEBASE.tex | |
PDFFILE=$FILEBASE.pdf | |
# errorexit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Quick & dirty watermark function | |
// inspired by https://github.com/marioestrada/jQuery-Watermark | |
(function ($){ | |
$.fn.watermark = function(){ | |
var $elems = $(this).filter('textarea, input[type="text"]'); | |
$elems.each(function(i, e){ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// send HTTP POST request | |
function send_http($url, $params = null, $type = 'GET') | |
{ | |
$type = strtoupper($type); // request type | |
if (!preg_match('/^(GET|POST)$/', $type)) { | |
die("Unsupported method type: '$type'"); | |
} | |
/* generate POST string */ | |
$query_string = ''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
b <- function(path = "package/", ...){ | |
require(devtools) | |
require(roxygen2) | |
pkg <- as.package(path) # package pointer | |
## update documentation | |
message("Updating documentation...") | |
roxygenise(path, ...) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -z $(lsmod | grep vboxdrv) ]; then | |
# load virtualbox module | |
gksudo modprobe vboxdrv | |
fi | |
# virtualbox module loaded | |
vm=`VBoxManage list vms | zenity --list --title="Virtualbox machines" --column="Machine"` | |
if [ ! -z "$vm" ]; then | |
VBoxManage startvm $vm |
NewerOlder