Skip to content

Instantly share code, notes, and snippets.

Ryan Burnette ryanburnette

Block or report user

Report or block ryanburnette

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View cmd
defaults write com.microsoft.VSCode CGFontRenderingFontSmoothingDisabled 0
defaults write com.microsoft.VSCode.helper CGFontRenderingFontSmoothingDisabled 0
defaults write com.microsoft.VSCode.helper.EH CGFontRenderingFontSmoothingDisabled 0
defaults write com.microsoft.VSCode.helper.NP CGFontRenderingFontSmoothingDisabled 0
@ryanburnette
ryanburnette / node.service
Last active Jul 9, 2019
Notes on running NodeJs as a systemd service
View node.service
[Unit]
Description=service
After=network.target
[Service]
Type=simple
User=ubuntu
WorkingDirectory=/opt/service
ExecStart=/bin/bash -c 'exec bin/node app.js 2>&1 >> logs/console.log'
Restart=always
View php-file-get-contents-basic-auth.php
<?php
//https://stackoverflow.com/a/30630753/2535178
$url = 'https://example.com/api/endpoint';
$auth = base64_encode("username:password");
$options = array(
'http' => array(
'method' => 'POST',
View meddleware.js
module.exports = function (req, res, next) {
// you won't believe what happens
next();
};
View gist:b5b3ef5efefff99438bf9e3a3538a0c5
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions
https://medium.com/tfogo/advantages-and-pitfalls-of-arrow-functions-a16f0835799e
My personal rule... only use arrow functions when you need the benefit of what they do. A
lot of folks default to them and I think this is a bad practice.
@ryanburnette
ryanburnette / index.js
Last active Mar 23, 2019
thoughts about integrating akismet api w/ my express-based form endpoints
View index.js
var akismet = require('akismet-api');
var client = akismet.client({
key: process.env.AKISMET_API_KEY,
blog: process.env.AKISMET_BLOG_URL
});
module.exports = client;
// verify akismet api key
@ryanburnette
ryanburnette / sass-to-scss.sh
Last active Mar 15, 2019
Convert all .scss to .sass in the current directory, or vice versa.
View sass-to-scss.sh
#!/usr/bin/env bash
for file in *.sass
do
sass-convert -F sass -T scss $file `echo $file | sed s/.sass/.scss/g`;
done
rm *.sass
View boilerplate.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<link rel="preload" href="/css/app.bundle.css" as="style">
<link rel="preload" href="/js/app.bundle.js" as="script">
<link rel="stylesheet" href="/css/app.bundle.css">
<!--[if IE]>
View tmux-pairing
# create tmux session w/ a socket file
tmux -S /tmp/tmux-pairing new-session -s pairing
# open up permissions on the socket file
chmod 777 /tmp/tmux-pairing
# all users connect to tmux session using the socket
tmux -S /tmp/tmux-pairing attach-session -t pairing
You can’t perform that action at this time.