Skip to content

Instantly share code, notes, and snippets.

View ffedoroff's full-sized avatar
🏠
Working from home

ffedoroff

🏠
Working from home
View GitHub Profile
@ffedoroff
ffedoroff / MakeSound.java
Created August 19, 2015 10:37
java sound fix
package com.sniper.shiyan;
import java.io.File;
import java.io.IOException;
import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.DataLine;
import javax.sound.sampled.LineUnavailableException;
@ffedoroff
ffedoroff / omsktarif.md
Last active August 29, 2015 14:13
omsk tarif

Мобильный интернет

Омск Январь 2015

Тарифы по привлекательности:

  • 122 руб в месяц 1825 MБ (Мегафон, 60МБ в сутки)
  • 150 руб в месяц 2465 МБ (MTC, 75МБ в сутки)
  • 152 руб в месяц 1 ГБ (Биллайн)
  • 190 руб в месяц 320 Кбит/с (Yota, вроде безлимит)
  • 136 руб в месяц 1520 MБ (Теле2, 50МБ в сутки)
public static void permutation()
{
string sourceText = "1bc23a";
// remove duplicates and sort
string[] s = sourceText.Select(c => c.ToString()).Distinct().OrderBy(c => c).ToArray();
int combinations = Factorial(s.Length);
int len = s.Length;
@ffedoroff
ffedoroff / resp
Created March 5, 2014 04:19
resp
.test {
width: 100%;
}
@media only screen and (min-device-width: 480px) {
.test {
width: 90%;
}
}
@ffedoroff
ffedoroff / sentry
Created December 19, 2013 10:44
sentry
Running service: 'http'
2013-12-19 10:40:35 [24035] [INFO] Starting gunicorn 0.17.2
2013-12-19 10:40:35 [24035] [INFO] Listening at: http://127.0.0.1:9000 (24035)
2013-12-19 10:40:35 [24035] [INFO] Using worker: sync
2013-12-19 10:40:35 [24046] [INFO] Booting worker with pid: 24046
2013-12-19 10:40:35 [24048] [INFO] Booting worker with pid: 24048
2013-12-19 10:40:35 [24047] [INFO] Booting worker with pid: 24047
Internal Server Error: /test/one/
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/Django-1.5.5-py2.7.egg/django/core/handlers/base.py", line 115, in get_response
@ffedoroff
ffedoroff / ihate.cpp
Last active December 29, 2015 13:29
I hate cpp
#include <StandardCplusplus.h>
#include <boost_1_51_0.h>
#include <vector>
#include "Arduino.h"
using namespace std;
class BaseSensor {
public:
const char* name;
virtual bool is_sonic() {return false;};
@ffedoroff
ffedoroff / arduino.cpp
Last active December 28, 2015 16:09
arduino.cpp
// есть базовый класс BaseSensor и есть у него наследники SonicSensor и остальные...
// у них у всех есть public: virtual void init() {}
// я точно проверил, что virtual не забыл
// объявляю все красиво и удобно для меня
BaseSensor sensors[] = {
SonicSensor ("s0", 13, 12, 55, 5000, 0),
SonicSensor ("s1", 11, 55, 5000, 0),
SonicSensor ("s2", 10, 55, 5000, 0),
SonicSensor ("s3", 9, 45, 5000, 0),
@ffedoroff
ffedoroff / arduino_trouble
Last active December 28, 2015 16:09
arduino trouble
BaseSensor sensors[] = {
SonicSensor ("s0", 13, 12, 55, 5000, 0),
SonicSensor ("s1", 11, 55, 5000, 0),
SonicSensor ("s2", 10, 55, 5000, 0),
SonicSensor ("s3", 9, 45, 5000, 0),
ButtonSensor ("b01", 8, 10, 100, 0),
ButtonSensor ("b02", 7, 10, 100, 0),
BoolSensor ("m1", 6, 5000, 0),
; supervisor config file
[unix_http_server]
file=/var/run//supervisor.sock ; (the path to the socket file)
chmod=0700 ; sockef file mode (default 0700)
[supervisord]
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP)