Skip to content

Instantly share code, notes, and snippets.

@j15e
j15e / add_frozen_string_comment.py
Created July 4, 2019 21:00
Sublime Text 3 automatically add frozen string literal: true
# Add to ~/Library/Application Support/Sublime Text 3/Packages/User/
import sublime
import sublime_plugin
class RubyFileSaveListener(sublime_plugin.EventListener):
def on_pre_save(self, view):
file_name = view.file_name()
if file_name.endswith('schema.rb'):
return
const int GAUCHE = 11;
const int BARRE = 10;
const int DROITE = 9;
const int BOUTON = A0;
int val;
int oldVal;
int counter = 5;
int delay1 = 1250;
int lastToggle = 0;
@j15e
j15e / exemple.ino
Created September 8, 2018 02:08
exemple arduino québec
#include "StandStats.h"
#include <Adafruit_GFX.h>
#include "Adafruit_LEDBackpack.h"
#include <Time.h>
#include <TimeLib.h>
#include <Preferences.h>
#include <driver/adc.h>
#include <Wire.h>
#include "WiFi.h"
Running RuboCop...
For /Users/j15e/repos/project: configuration from /Users/j15e/repos/project/.rubocop.yml
Inspecting 173 files
Scanning /Users/j15e/repos/project/Guardfile/...
.Scanning /Users/j15e/repos/project/Rakefile/...
.Scanning /Users/j15e/repos/project/app/...
.Scanning /Users/j15e/repos/project/app/...
.Scanning /Users/j15e/repos/project/app/...
.Scanning /Users/j15e/repos/project/app/...
.Scanning /Users/j15e/repos/project/app/...
@j15e
j15e / group.c
Last active September 28, 2017 02:54
group feeds issue
#define WIFI_SSID ""
#define WIFI_PASS ""
#define IO_USERNAME ""
#define IO_KEY ""
#define SET_PIN 14
#define UNSET_PIN 12
#include "SPI.h"
#include "AdafruitIO_WiFi.h"
AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);
@j15e
j15e / mqttesp.h
Created September 26, 2017 12:21
#define WLAN_SSID "..."
#define WLAN_PASS "..."
#define WLAN_HOSTNAME "gardenrelay-1"
#define IO_USERNAME "j15e"
#define IO_KEY "..."
#define FEED_PATH IO_USERNAME "/f/garden/"
#define SET_PIN 5
#define UNSET_PIN 4
@j15e
j15e / keybase.md
Created November 11, 2015 00:00
keybase.md

Keybase proof

I hereby claim:

  • I am j15e on github.
  • I am j15e (https://keybase.io/j15e) on keybase.
  • I have a public key whose fingerprint is 4857 E312 5BE7 DE8B 5F64 7078 F818 4BB3 0334 0691

To claim this, I am signing this object:

@j15e
j15e / csp_reporter.rb
Last active August 31, 2015 14:05
Content Security Policy Violation Reporter
# Jean-Philippe Doyle, Copyright (c) 2015
# Licence MIT
# @see http://opensource.org/licenses/MIT
# Logs CSP report in rails logs sent to REPORT_URI
class CSPReportLogger
BLOCKED_URI_KEY = 'blocked-uri'.freeze
CSP_REPORT_KEY = 'csp-report'.freeze
IGNORE = %w{safari-extension://}.map { |src| /\A#{src}/.freeze }.freeze
LOG_HEADER = '[SECURITY] CSP Violation Report'.freeze
@j15e
j15e / security@didacte.com.asc
Last active August 29, 2015 14:19
Didacte Security Team
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBFUsdv4BEADQmlk9VcqwOFaK+4zWFk6YCZgWrLhtJMePeQEtViLSEycqTdt3
y61h1ulrMm4Tg8Z0VKcfUdv76/4n2Ni17YgTLbrjROCFlBoVZqQALFj76wg0Lnkg
uvg0fbNwsMMOS9wx+R8nW48Wz6gcw5DIA/14dYEUfPDOzd/97p9rkH7BUSF3bTG/
BgVPOzoH9+3c+xpkj5wXWv3xRpQtqiVIoMHM6lbOG4OEJtvyt+GU0MaZLlcaBHRn
K8FeJyNfZ3cMdHYX/EnLrtDy4Ibvym1YV0BJf2dX34ahWnHieEelpGVuKMzE7eZS
h4A6pS01BiZSt7vIFM+1LG+Ub5Uc3wBaITCFkgjwFzRiZG8zD0c3X/ENiyBpn4va
Aah1szTTyyM1beq41V04BZiVTHwo0/lo6jodcmXyat9oF6flOGfy3bjlMNxI6NWp
SKIUzPob4FdNHVq1NOPT0YIudChISbPQ8KvT977/iIHMI2rSnDQjh7zcd07Oa1Jt
@j15e
j15e / gist:83275f0e91c24bf3f711
Created January 13, 2015 19:51
app details ember-cli perf regression

Our setup details below. Our Brocfile.js is quite custom so there might be an issue with something there.

app:              373 files, 1.4MB total
bower_components: 1075 files, 14MB total
node_modules:     39 000 files, 184MB
vendor:           10 files, 193KB