Skip to content

Instantly share code, notes, and snippets.

View morozgrafix's full-sized avatar

Sergey Morozov morozgrafix

View GitHub Profile
@morozgrafix
morozgrafix / sos_blink.ino
Created March 1, 2018 00:16
SOS Blink to test out new Arduino Boards
@morozgrafix
morozgrafix / Preferences.sublime-settings
Last active April 26, 2017 16:57
Tommorow-Night Theme with guide highlights
{
"indent_guide_options":
[
"draw_normal",
"draw_active"
]
}
@morozgrafix
morozgrafix / index.html
Created April 25, 2017 22:09
platform xkcd
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css">
<script src="http://cmx.io/v/0.1/cmx.js" charset="utf-8"></script>
<style>.cmx-user-scene4 .cmx-text-border .cmx-path {stroke: orange}</style>
<body>
<div style="max-width:900px; -webkit-transform:rotate(0deg)">
<scene id="scene1">
<label t="translate(0,346)">
@morozgrafix
morozgrafix / MagicMirror_on_CHIP.md
Created January 28, 2017 08:49
MagicMirror on $9 C.H.I.P. Installation Instructions
@morozgrafix
morozgrafix / darksky3.json
Last active January 18, 2017 19:51
heavy rain response
{
"alerts": [
{
"description": "...WIND ADVISORY IN EFFECT TODAY FOR STRONG FRONTAL PASSAGE...\n.A STRONG COLD FRONT WILL PASS OVER THE BAY AREA AND CENTRAL\nCOAST THIS AFTERNOON AND EVENING. IN ADDITION TO RAINFALL THE\nFAST MOVING FRONT WILL BRING A PERIOD OF STRONG SOUTHERLY WINDS\nAHEAD OF THE FRONT BEFORE WINDS QUICKLY TURN TO THE NORTHWEST AND\nDIMINISH BEHIND THE FRONT. WIND GUSTS TO 50 MPH WILL BE POSSIBLE\nNEAR THE COAST AND HILLS WITH FREQUENT GUSTS FROM 40 TO 45 MPH\nPOSSIBLE IN THE LOWER ELEVATIONS.\n...WIND ADVISORY REMAINS IN EFFECT FROM 1 PM THIS AFTERNOON TO\n1 AM PST THURSDAY...\n* TIMING...THIS AFTERNOON AND TONIGHT.\n* WINDS...SOUTHERLY WIND GUSTS FROM 40 TO 50 MPH...STRONGEST\nNEAR THE COAST AND IN THE HILLS ABOVE 1000 FEET.\n* IMPACTS...DOWNED TREES...LIMBS AND POWERLINES LEADING TO\nPOSSIBLE POWER OUTAGES. DRIVING OF HIGH PROFILE VEHICLES WILL\nBE DIFFICULT DURING PERIODS OF STRONG WINDS ALONG WITH EXTRA\nDEBRIS ON AREA ROADS.\n",
"expires": 1484816400
@morozgrafix
morozgrafix / darksky2.json
Created December 22, 2016 00:20
response with rain
{
"latitude": 49.4939,
"longitude": 0.108,
"timezone": "Europe/Paris",
"offset": 1,
"currently": {
"time": 1482365971,
"summary": "Rain",
"icon": "rain",
"nearestStormDistance": 0,
@morozgrafix
morozgrafix / darksky1.json
Created December 20, 2016 22:36
example of dark sky json response
{
"latitude": 37.752881,
"longitude": -122.456429,
"timezone": "America/Los_Angeles",
"offset": -8,
"currently": {
"time": 1482272606,
"summary": "Partly Cloudy",
"icon": "partly-cloudy-day",
"nearestStormDistance": 2,
@morozgrafix
morozgrafix / slack_slash_command_template.php
Created January 19, 2016 20:24
Basic Slack Slash Command Bot Template in PHP
<?php
// Authorized team tokens that you would need to get when creating a slash command. Same script can serve multiple teams, just keep adding tokens to the array below.
$valid_tokens = array(
"123asdzxcvasdfasdwasdfas", // key 1
"234xdfqadfsdfasdfasfasdf" // key 2
);
if (!in_array($_REQUEST['token'], $valid_tokens)) {
bot_respond(":no_good: *Unauthorized token!* Feel free to grab a copy of this script and host it yourself.");
@morozgrafix
morozgrafix / timing_curl.md
Last active October 25, 2018 03:23
Time CURL requests
@morozgrafix
morozgrafix / OS X Emoji Characters and Categories.md
Last active August 29, 2015 14:16
OS X Emoji Characters and Categories

Generate JSON file and save to current directory:

plutil -convert json -r -o `sw_vers -productVersion`.json /System/Library/Input\ Methods/CharacterPalette.app/Contents/Resources/Category-Emoji.plist

Generate JSON file and copy to clipboard:

plutil -convert json -r -o - /System/Library/Input\ Methods/CharacterPalette.app/Contents/Resources/Category-Emoji.plist | pbcopy