Skip to content

Instantly share code, notes, and snippets.

View theotheo's full-sized avatar
🌴
On vacation

theotheo

🌴
On vacation
View GitHub Profile
body {
font-family: Helvetica, Verdana
}
p {
padding: 7px 10px;
}
#demo {
border: 1px solid #999;
}
@theotheo
theotheo / oceans-clip.srt
Created February 25, 2013 07:38
.srt example
1
00:00:01,000 --> 00:00:05,000
Hello, World!
2
00:00:05,000 --> 00:00:12,000
The second subtitle.
@theotheo
theotheo / ocean-clip.vtt
Last active December 14, 2015 04:29
.vtt example
WEBVTT
00:01.000 --> 00:05.000
Hello, World!
00:05.000 --> 00:12.000
The second subtitle.
@theotheo
theotheo / code.R
Last active August 29, 2015 14:08
DM Track. Lesson 2.
# > install.packages("gridExtra")
require(gridExtra)
require(ggplot2)
# read kaggle data
stores <- read.csv("raw/stores.csv", header = T)
features <- read.csv("raw/features.csv", header = T)
train <- read.csv("raw/train.csv", header = T)
# create list of stores by splitting train data by store number
int switchPin = 6;
int ledPin = 4;
boolean lastButton = LOW;
boolean currentButton = LOW;
int ledLevel = 0;
void setup()
{
pinMode(switchPin, INPUT);
@theotheo
theotheo / json
Created November 11, 2014 00:21
fastfive
{
"cards": {},
"externalIds": {
"imdbId": "tt1596343"
},
"uuid": "692e5796-ea3f-4446-ad7d-d0fefd9d6615",
"duration": 7843000,
"title": "Fast Five",
"isoStartDateUtc": "2014-10-24T23:38:03.000Z",
"startDateUtc": 1414193883000,
var ClbhObject = function(win, doc) {
function sendGaEvent(p1, p2, p3, p4) {
win.ga_cbh && ga_cbh(p1, p2, p3, p4), win.ga && ga(p1, p2, p3, p4)
}
function initGA() {
return "undefined" != typeof h_params.ga_disable && 1 == h_params.ga_disable ? !1 : (ga_cbh = null, function(i, s, o, g, r, a, m) {
i.GoogleAnalyticsObject = r, i[r] = i[r] || function() {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date, a = s.createElement(o), m = s.getElementsByTagName(o)[0], a.async = 1, a.src = g, m.parentNode.insertBefore(a, m)
@theotheo
theotheo / example.log
Created December 5, 2014 14:48
Example linear regression for "iris" dataset
> iris.fit <- lm(Petal.Width ~ Petal.Length, data=iris)
> summary(iris.fit)
Call:
lm(formula = Petal.Width ~ Petal.Length, data = iris)
Residuals:
Min 1Q Median 3Q Max
-0.56515 -0.12358 -0.01898 0.13288 0.64272
@theotheo
theotheo / 0_reuse_code.js
Last active August 29, 2015 14:23
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
class RightTriangle {
// a и b -- длинны катетов
private final double a, b;
// конструктор класса
RightTriangle(double a, double b) {
// проверка на то, что катеты заданы положительными числами
if(a <= 0 || b <= 0) {
// выдаем ошибку, если любои из катетов задан не положительным числом
throw new IllegalArgumentException("a and b should be positive");