Skip to content

Instantly share code, notes, and snippets.

@chrismdp
chrismdp / s3.sh
Last active Apr 3, 2021
Uploading to S3 in 18 lines of Shell (used to upload builds for http://soltrader.net)
View s3.sh
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1
@jennybc
jennybc / yaml_frontmatter_r_github_document.yaml
Last active Mar 27, 2021
YAML frontmatter for R Markdown to cause rmarkdown::render() to retain intermediate Markdown file for .R and .Rmd files, respectively
View yaml_frontmatter_r_github_document.yaml
#' ---
#' title: "Something fascinating"
#' author: "Jenny Bryan"
#' date: "`r format(Sys.Date())`"
#' output: github_document
#' ---
View samizdat-shell-help.bash
#!/bin/bash
###
### my-script — does one thing well
###
### Usage:
### my-script <input> <output>
###
### Options:
### <input> Input file to read.
### <output> Output file to write. Use '-' for stdout.
@niksudan
niksudan / mc-server-setup.md
Last active Mar 23, 2021
How to create a new Minecraft Server with DigitalOcean
View mc-server-setup.md

Creating a new Minecraft Server

This is a short and simple guide on how to set up a multiplayer server running the latest version of Minecraft.

This guide has been tested on Ubuntu 16.04 and 18.04.

Setup

Create a new Ubuntu droplet on DigitalOcean. Make sure it has at least 2GB of RAM, and you provide it with your SSH key.

@mikermcneil
mikermcneil / disabling-macosx-notification-center.md
Last active Feb 10, 2021
Disable/Enable Notification Center (MacOS X)
View disabling-macosx-notification-center.md

Toggle MacOS X Notification Center on or off

This gist is to remind me (and anyone else who it helps) how to quickly disable and re-enable Notification Center.

Set Up Bash Aliases

Installation

  1. Open your terminal (<⌘ + ␣ (spacebar)>, then type "terminal", then press < (enter)>).
@johnschrom
johnschrom / gist:8638763
Last active Jan 5, 2021
Making a map of foursquare checkins
View gist:8638763
library(ggplot2)
library(maps)
library(mapproj)
###############################################################################
# Step 1: Get data from Foursquare
# If you already have it, then great :) Otherwise, you can use RPI. The source
# is listed below, and there are instructions for getting keys in the readme.
# RPI: https://github.com/johnschrom/RPI
@skranz
skranz / s_dplyr
Created Mar 21, 2014
Wrappers to dplyr's data modification functions like arrange, select,... that work with string arguments.
View s_dplyr
# Helper functions that allow string arguments for dplyr's data modification functions like arrange, select etc.
# Author: Sebastian Kranz
# Examples are below
#' Modified version of dplyr's filter that uses string arguments
#' @export
s_filter = function(.data, ...) {
eval.string.dplyr(.data,"filter", ...)
}
@netmute
netmute / README.md
Last active Sep 25, 2020
Game of Life
View README.md

Game of Life

An implementation of Conway's Game of Life in 140 characters of Ruby.

Author

Created by Simon Ernst (@sier).

@jcheng5
jcheng5 / server.R
Last active Aug 17, 2020
Shiny example: Diamonds Explorer
View server.R
library(shiny)
library(ggplot2)
function(input, output) {
dataset <- reactive({
diamonds[sample(nrow(diamonds), input$sampleSize),]
})
output$plot <- renderPlot({
@pncnmnp
pncnmnp / news_corpus.txt
Last active Jun 10, 2020
22 years ( 1995 - 2017 ) worth of news scrapped from Wikipedia ( with dates )
View news_corpus.txt
This file has been truncated, but you can view the full file.
Current events of September 3, 1995 (1995-09-03) (Sunday) :
eBay is founded.
Current events of September 6, 1995 (1995-09-06) (Wednesday) :
NATO air strikes against Bosnian Serb forces continue, after repeated attempts at a solution to the Bosnian War fail.
Current events of September 19, 1995 (1995-09-19) (Tuesday) :
The Washington Post and The New York Times publish the Unabomber's manifesto.
Current events of September 22, 1995 (1995-09-22) (Friday) :
American millionaire Steve Forbes announces his candidacy for the 1996 Republican presidential nomination.
Current events of September 23, 1995 (1995-09-23) (Saturday) :