Skip to content

Instantly share code, notes, and snippets.

View msurguy's full-sized avatar

Maksim Surguy msurguy

View GitHub Profile
@msurguy
msurguy / chase
Created March 7, 2016 17:53 — forked from jwhendy/chase
#include "FastLED.h"
// must use fastLED 3.1: https://github.com/FastLED/FastLED/tree/FastLED3.1
// fast led constants and initialize
#define DATA_PIN 9
#define LED_TYPE WS2812B
#define COLOR_ORDER GRB
#define NUM_LEDS 48
CRGB leds[NUM_LEDS];
@msurguy
msurguy / LED cloud v.2
Created March 7, 2016 17:53 — forked from mock-turtle/LED cloud v.2
Updated cloud code. Patterns should play on button press.
//import the necessary libraries
#include "FastLED.h"
#include "IRremote.h"
//define some variables
#define LEDPIN 6
#define RECV_PIN 3
#define LED_TYPE NEOPIXEL
#define NUM_LEDS 15
#define BRIGHTNESS 200
@msurguy
msurguy / readme.md
Created September 8, 2015 16:59
Nginx push stream install

wget http://nginx.org/download/nginx-1.4.6.tar.gz (substitute with latest version of Nginx or version that you have installed currently)

tar xzvf nginx-1.4.6.tar.gz

./configure --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-ipv6 --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_addition_module --with-http_dav_module --with-http_geoip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_spdy_module --with-http_sub_module --with-http_xslt_module --with-mail --with-mail_ssl_module --with-poll_module --add-module=/home/forge/nginx

@msurguy
msurguy / demo.html
Created April 30, 2015 19:20
canvas css image
<!DOCTYPE html>
<!--
Copyright 2012 Eric Bidelman
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@msurguy
msurguy / rafParallax.js
Created April 15, 2015 18:26
parallax via requestAnimationFrame
var $content = $('header .content')
, $blur = $('header .overlay')
, wHeight = $(window).height();
$(window).on('resize', function(){
wHeight = $(window).height();
});
/**
* requestAnimationFrame Shim
// Use this if you believe the iframe may have dynamic content and could change size after it has completely loaded //
// Your Domain Name //
var parent_domain = "http://www.example.com/";
setInterval(function() {
var iframe_height = parseInt($('html').height());
// Add Padding to insure nothing is creating a scroll bar //
iframe_height += 30;
<link rel="import" href="../core-animated-pages/core-animated-pages.html">
<link rel="import" href="../core-animated-pages/transitions/hero-transition.html">
<link rel="import" href="../core-animated-pages/transitions/cross-fade.html">
<link rel="import" href="../core-animated-pages/transitions/slide-down.html">
<link rel="import" href="../core-animated-pages/transitions/slide-up.html">
<link rel="import" href="../core-animated-pages/transitions/tile-cascade.html">
<link rel="import" href="../paper-tabs/paper-tab.html">
<link rel="import" href="../paper-tabs/paper-tabs.html">
<link rel="import" href="../paper-radio-button/paper-radio-button.html">
@msurguy
msurguy / Boxfile
Last active August 29, 2015 14:01
Sample Boxfile (for a laravel application) and example of using DB credentials in the app
web1:
document_root: public
php_version: 5.4.14
php_upload_max_filesize: "10M"
php_post_max_size: "10M"
php_extensions:
- mbstring
- mcrypt
- curl
- gd
@msurguy
msurguy / install.sh
Last active August 30, 2021 21:18
Installing VIPS on Digital Ocean (Ubuntu 14). VIPS (http://www.vips.ecs.soton.ac.uk/) is super fast image processor that performs faster than anything else. Please read the comments for even quicker install
cat ~/.ssh/id_rsa.pub | ssh forge@yourserverIP "cat >> ~/.ssh/authorized_keys"
ssh 'forge@yourserverIP'
mkdir vips
cd vips
wget -c http://www.vips.ecs.soton.ac.uk/supported/current/vips-7.38.5.tar.gz
tar xzvf vips-7.38.5.tar.gz
cd vips-7.38.5/
@msurguy
msurguy / CleanDirs.php
Created May 8, 2014 07:05
Clean temporary folders
<?php
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
class CleanDirs extends Command {
protected $name = 'cleandirs';