This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.
— Erik
# found this from Armin R. on Twitter, what a beautiful gem ;) | |
import ctypes | |
from types import DictProxyType, MethodType | |
# figure out side of _Py_ssize_t | |
if hasattr(ctypes.pythonapi, 'Py_InitModule4_64'): | |
_Py_ssize_t = ctypes.c_int64 | |
else: | |
_Py_ssize_t = ctypes.c_int |
#!/usr/bin/python | |
import smtplib | |
from email.MIMEMultipart import MIMEMultipart | |
from email.MIMEBase import MIMEBase | |
from email.MIMEText import MIMEText | |
from email import Encoders | |
import os | |
gmail_user = "[email protected]" |
# 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) | |
} |
tell application "Mail" | |
set theSubject to "Subject" -- the subject | |
set theContent to "Content" -- the content | |
set theAddress to "[email protected]" -- the receiver | |
set theSignatureName to "signature_name"-- the signature name | |
set theAttachmentFile to "Macintosh HD:Users:moligaloo:Downloads:attachment.pdf" -- the attachment path | |
set msg to make new outgoing message with properties {subject: theSubject, content: theContent, visible:true} |
:: If you want to use a batch file try this. Make a shortcut and drag n drop the file to be validated on it | |
Call "mrScriptCL.exe" "{path_to_mrs_validator}\ProjectValidator.mrs" /a:mddpath=%1 | |
PAUSE |
#.dsl_headwords | |
#{ | |
# white-space: nowrap; | |
#} | |
#.gddictname | |
#{ | |
# width: 50%; | |
# white-space: nowrap; | |
# text-overflow: ellipsis; | |
# overflow: hidden; |
library(vegan) | |
library(labdsv) | |
data(varespec) | |
data(varechem) | |
vare.cca <- cca(varespec ~ Baresoil+Humdepth+pH+N+P+K+Ca+Mg+S+Al+Fe, data=varechem) | |
vare.cca | |
plot(vare.cca) | |
summary(vare.cca) |
# Create explicit data frames and TS objects given a list | |
market.list<- c("GR","CY","RU","RO","PL","UA","ROW") | |
for (i in market.list) { | |
tmp <- subset(data,Market==i) | |
tmp<-ts(tmp) # It's a timeseries afterall... | |
# Let's save the data somewhere so we don't get back all the time | |
filename <- paste("data_", i, sep="") | |
assign(filename, tmp) | |
save(filename, file=paste(filename, ".rda",sep="")) | |
} |
#!/bin/bash | |
# Takes contents of clipboard, syntax highlights them, places a copy in "gists" directory in Google Drive, pastes them into a gist, opens the gist in a browser, and puts syntax highlighted version of text in clipboard for pasting into Evernote/email/etc | |
# requires: | |
#* gist (https://github.com/defunkt/gist) | |
#* Google Drive | |
#* highlight (brew install highlight) | |
#* an alias that will run this file `alias gst="~/gst.sh"` |