Skip to content

Instantly share code, notes, and snippets.

View xtepwxly's full-sized avatar

Alexander Mitelman xtepwxly

  • ContentIQ
  • Tel Aviv
View GitHub Profile
@xtepwxly
xtepwxly / php
Last active September 12, 2015 13:27
curl sucks or I suck? :D
$years = array('2012', '2013', '2014', '2015');
foreach($years as $year)
{
$url = "http://lpo.dt.navy.mil/data/DM/Environmental_Data_Deep_Moor_{$year}.txt";
$fp = fopen(base_path() . "/database/rawdata/{$year}.txt", 'w');
$curl = curl_multi_init();
curl_setopt_array($curl, array(
CURLOPT_URL => $url,
CURLOPT_FILE => $fp,
<?php
namespace App\Http\Controllers;
use App\EnviromentalData;
use App\Datasets\StatisticsDataset;
use App\Services\TransformService;
use Illuminate\Http\Request;
use App\Http\Requests;
@xtepwxly
xtepwxly / candy.php
Last active September 18, 2015 15:55
Fractal
<?php
$resource = new Fractal\Resource\Collection($envData, function(EnviromentalData $env) {
return [
'Data Recorded' => $env->data_recorded,
'Mean Temperature' => (new StatisticsDataset($env->air_temp))->getMean(),
'Median Temperature' => (new StatisticsDataset($env->air_temp))->getMedian(),
'Mean Pressure' => (new StatisticsDataset($env->bar_press))->getMean(),
'Median Pressure' => (new StatisticsDataset($env->bar_press))->getMedian(),
'Mean Speed' => (new StatisticsDataset($env->wind_speed))->getMean(),
@xtepwxly
xtepwxly / gulpfile.js
Created September 19, 2015 13:59
gulpfile.js
var gulp = require('gulp'),
sass = require('gulp-sass'),
uglify = require('gulp-uglify'),
concat = require('gulp-concat');
var bowerPath = 'private/bower_components/';
gulp.task('default', ['js-minify', 'js-minify:watch', 'sass', 'sass:watch', 'css']);
gulp.task('js', function() {
@xtepwxly
xtepwxly / angular.js
Last active September 23, 2015 17:31
angular
(function() {
// /users/:user and then using /streams/:user
var twitchUsers = [
'freecodecamp', 'goldglove', 'cohhcarnage', 'ellohime', 'siloz', 'xsmak', 'mushisgosu', 'medrybw'
];
var twitchApp = angular.module('twitchApp', []);