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
stratifiedDT <- function(indt, group, size, select = NULL, | |
replace = FALSE, keep.rownames = FALSE, | |
bothSets = FALSE) { | |
if (is.numeric(group)) group <- names(indt)[group] | |
if (!is.data.table(indt)) indt <- as.data.table( | |
indt, keep.rownames = keep.rownames) | |
if (is.null(select)) { | |
indt <- indt | |
} else { | |
if (is.null(names(select))) stop("'select' must be a named list") |
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/ruby | |
# Make sure you have these gems installed | |
require 'rubygems' | |
require 'thread' | |
require 'csv' | |
require 'twitter' | |
require 'marky_markov' | |
# Create a new Twitter account that you'd like to have your auto-tweets posted to |
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
'''cjson, jsonlib, simplejson, and yajl also use C code | |
demjson did not use C code, but was too painfully slow to benchmark | |
(took about 20 seconds for these tests) | |
''' | |
import json | |
import sys | |
import time | |
with open('doc.json') as f: |
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
### R code from vignette source 'Presentation.Rnw' | |
### Encoding: UTF-8 | |
################################################### | |
### code chunk number 1: init | |
################################################### | |
options(width=60) | |
################################################### |
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 | |
# ANSI Color -- use these variables to easily have different color | |
# and format output. Make sure to output the reset sequence after | |
# colors (f = foreground, b = background), and use the 'off' | |
# feature for anything you turn on. | |
initializeANSI() | |
{ | |
esc="" |
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
# A simple PowerShell script for retrieving the RAID status of volumes with help of diskpart. | |
# The nicer solution would be using WMI (which does not contain the RAID status in the Status field of Win32_DiskDrive, Win32_LogicalDisk or Win32_Volume for unknown reason) | |
# or using the new PowerShell API introduced with Windows 8 (wrong target system as our customer uses a Windows 7 architecture). | |
# | |
# diskpart requires administrative privileges so this script must be executed under an administrative account if it is executed standalone. | |
# check_mk has this privileges and therefore this script must only be copied to your check_mk/plugins directory and you are done. | |
# | |
# Christopher Klein <ckl[at]neos-it[dot]de> | |
# This script is distributed under the GPL v2 license. |
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 | |
# | |
# transcode-video.sh | |
# | |
# Copyright (c) 2013-2015 Don Melton | |
# | |
about() { | |
cat <<EOF | |
$program 5.13 of April 8, 2015 |
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
# ipak function: install and load multiple R packages. | |
# check to see if packages are installed. Install them if they are not, then load them into the R session. | |
ipak <- function(pkg){ | |
new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])] | |
if (length(new.pkg)) | |
install.packages(new.pkg, dependencies = TRUE) | |
sapply(pkg, require, character.only = 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
### | |
### | |
### UPDATE: For Win 11, I recommend using this tool in place of this script: | |
### https://christitus.com/windows-tool/ | |
### https://github.com/ChrisTitusTech/winutil | |
### https://www.youtube.com/watch?v=6UQZ5oQg8XA | |
### iwr -useb https://christitus.com/win | iex | |
### | |
### |
OlderNewer