Skip to content

Instantly share code, notes, and snippets.

View noxasch's full-sized avatar

Alexander Dischberg noxasch

View GitHub Profile
@noxasch
noxasch / ruby-vscode-extensions.jsonc
Last active June 1, 2022 06:11
Ruby VSCode extension
{
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"castwide.solargraph",
"mhutchie.git-graph",
"connorshea.vscode-ruby-test-adapter",
"elliotlarson.ruby-around-the-block",
@noxasch
noxasch / mac-setup-redis.md
Created August 18, 2021 07:11 — forked from tomysmile/mac-setup-redis.md
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis
@noxasch
noxasch / kanban_test.dart
Created June 2, 2021 02:40 — forked from cristianvasquez/kanban_test.dart
Example of a drag and drop Kanban in Flutter
import 'dart:collection';
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
@noxasch
noxasch / netlify.toml
Created May 16, 2021 22:30
netlify.toml for header which CSP from various CDN
[[headers]]
for = "/*"
[headers.values]
X-Frame-Options = "DENY"
X-XSS-Protection = "1; mode=block"
X-Content-Type-Options = "nosniff"
Referrer-Policy = "no-referrer"
Content-Security-Policy = '''
default-src 'self';
font-src fonts.gstatic.com; style-src 'self' fonts.googleapis.com;
{
"Africa/Abidjan": "+00:00",
"Africa/Accra": "+00:00",
"Africa/Addis_Ababa": "+03:00",
"Africa/Algiers": "+01:00",
"Africa/Asmara": "+03:00",
"Africa/Asmera": "+03:00",
"Africa/Bamako": "+00:00",
"Africa/Bangui": "+01:00",
"Africa/Banjul": "+00:00",
@noxasch
noxasch / default-npmrc
Created February 6, 2020 19:24 — forked from mrzool/default-npmrc
The default npmrc
;;;;
; npm userconfig file
; this is a simple ini-formatted file
; lines that start with semi-colons are comments.
; read `npm help config` for help on the various options
;;;;
;;;;
; all options with default values
;;;;
@noxasch
noxasch / responsive mixin
Created October 12, 2019 12:58 — forked from davidthingsaker/responsive mixin
SCSS / Sass mixin for responsive sites
$small-desktop: 960px;
$large-desktop: 1200px;
$handheld: 768px;
$handhelds-landscape: 1024px;
$mobile: 640px;
$mobile-landscape: 480px;
@mixin respond-to($media) {
@if $media == largeDesktop {
@media only screen and (min-width: $large-desktop) { @content }
@noxasch
noxasch / docusaurus-copy-button.md
Created March 9, 2019 18:03 — forked from yangshun/docusaurus-copy-button.md
How to add the "Copy" button to code blocks in Docusaurus

Adding "Copy" (to Clipboard) Button

If you would like to add a button to your fenced code blocks so that users may copy the code, you can do so in Docusaurus. You will have to add some code to your Docusaurus project, as seen below.

Under static/js, create a file called code-block-buttons.js with the following:

// Turn off ESLint for this file because it's sent down to users as-is.
/* eslint-disable */
window.addEventListener('load', function() {
@noxasch
noxasch / get_mac_address.py
Created September 6, 2018 21:58 — forked from zhenyi2697/get_mac_address.py
Python: get mac address of a interface
import socket
import fcntl
import struct
def getHwAddr(ifname):
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
info = fcntl.ioctl(s.fileno(), 0x8927, struct.pack('256s', ifname[:15]))
return ''.join(['%02x:' % ord(char) for char in info[18:24]])[:-1]
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
while True:
message = input("Enter your message: ")
s.sendto(message.encode('utf-8'), ('localhost', 9000))
s.close()