Skip to content

Instantly share code, notes, and snippets.

View kahrpatrick's full-sized avatar

Patrick Kahr kahrpatrick

View GitHub Profile

To embed the contents of an SVG file into your site using NextJS 12 with the new Rust-based compiler, perform the following steps:

  1. Install @svg/webpack:
$ npm install --save-dev @svgr/webpack
  1. Create a svgr.config.js config file with the following contents. This will remove the width and height from the SVG but keep the viewBox for correct scaling.
@Ahmed-Galal
Ahmed-Galal / server.py
Created February 21, 2018 15:35 — forked from mdonkers/server.py
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
import logging
class S(BaseHTTPRequestHandler):
@mishriky
mishriky / ResilientClientSamples.scala
Created February 7, 2017 18:26
Samples for Finagle Client Configuration
/**
* This is not meant to cover ALL possible ways of creating service clients; instead it focuses on the simplest way to
* do so, while maintaining the capability to customize the clients based on service level agreements/expectations
*
* @note Most of the filters can be applied to the HTTP client as well but have been omitted from the sample code to improve
* readability
*/
trait ClientSamples extends LazyLogging {
private[this] lazy val config = ConfigFactory.load()
@accrane
accrane / change-user-role-mysql.txt
Created March 15, 2016 19:44
Change WordPress User Role to Admin mySql
-- Look at the field called "id" in the result set
--
select * from wp_users
where user_login = 'WORDPRESS_USERNAME_GOES_HERE';
-- Substitute the above "id" value in the "user_id" field below.
-- This is an integer value so do not use quotes around it
-- For example if the above "id" is the value 10 then the resulting line would be: where user_id = 10
--
update wp_usermeta