Skip to content

Instantly share code, notes, and snippets.

View msurguy's full-sized avatar

Maksim Surguy msurguy

View GitHub Profile
@NNTin
NNTin / savePastDiscordChat.py
Created November 28, 2016 07:37
goes through a text channel's chat log and writes it to a file
import discord
import asyncio
client = discord.Client()
@client.event
async def on_ready():
print('Logged in as')
print(client.user.name)
print(client.user.id)
@Lewiscowles1986
Lewiscowles1986 / rPi3-ap-setup.sh
Last active March 31, 2025 15:46
Raspberry Pi 3 access-point-setup
#!/bin/bash
#
# This version uses September 2017 august stretch image, please use this image
#
if [ "$EUID" -ne 0 ]
then echo "Must be root"
exit
fi
@mock-turtle
mock-turtle / LED cloud v.2
Last active March 7, 2016 17:53
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
@tullo-x86
tullo-x86 / colorutils.h
Last active March 8, 2016 04:05
fill_gradient with palette support
// Fill an array of colors with a sixteen-stop gradient from a palette.
// Only suitable for really long fades where banding must be minimised.
template <typename T>
void fill_gradient( T* targetArray, uint16_t numLeds,
const CHSVPalette16& palette,
TGradientDirectionCode directionCode = SHORTEST_HUES )
{
uint16_t spanLength = (numLeds / 15);
for (uint8_t spanIdx = 0; spanIdx < 14; spanIdx++)
@bellbind
bellbind / index.html
Last active October 26, 2017 04:48
[html5][devicemotion]live demo of devicemoton event
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>devicemotion event</title>
<script src="script.js"></script>
</head>
<body>
<h1>devicemotion event demo</h1>
<p>
@meziantou
meziantou / Index.html
Last active February 24, 2025 08:49
Javascript - Record audio
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<h1>Audio</h1>
<?php
namespace Acme\Html;
use Illuminate\Html\FormBuilder as IlluminateFormBuilder;
class FormBuilder extends IlluminateFormBuilder {
/**
* An array containing the currently opened form groups.
@msurguy
msurguy / Instructions.md
Last active May 14, 2019 16:38
Daily reports in 5 minutes with Laravel and Morris.js

Follow this guide to integrate bar chart reports into your Laravel application. Reports like the following come with this guide:

  • Total number of Orders by day
  • Total number of Users subscribed by day
  • etc

The library used for the charts is: http://www.oesmith.co.uk/morris.js/

First put this into your page that will have the reports (in the Blade view) to include Morris library:

@nioto
nioto / PiCameraStream
Created March 4, 2014 10:14
Simple MJpeg streamer for Raspberri Pi Camera
#!/usr/bin/python
'''
A Simple mjpg stream http server for the Raspberry Pi Camera
inspired by https://gist.github.com/n3wtron/4624820
'''
from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer
import io
import time
import picamera
@imjakechapman
imjakechapman / gulpfile.js
Last active August 29, 2015 13:56
My personal base Gulpfile
// Gulp Requires
var gulp = require('gulp'),
gutil = require('gulp-util'),
uglify = require('gulp-uglify'),
notify = require('gulp-notify'),
sass = require('gulp-sass'),
livereload = require('gulp-livereload'),
rjs = require('gulp-requirejs');
// Node requires for exec and sys