Skip to content

Instantly share code, notes, and snippets.

View brsnik's full-sized avatar

Boris Nikk brsnik

  • Skopje, MK
  • 01:04 (UTC +02:00)
View GitHub Profile
@yingshaoxo
yingshaoxo / asyncio_server.py
Last active July 8, 2020 08:05
asyncio TCP server
import asyncio
class EchoServerClientProtocol(asyncio.Protocol):
def connection_made(self, transport):
self.transport = transport
self.peername = transport.get_extra_info('peername')
print('Connection from {}'.format(self.peername))
def data_received(self, data):
@ryantbrown
ryantbrown / s3upload.sh
Created February 1, 2018 07:25
Bash script to Upload folder to S3
# Set AWS credentials and S3 paramters
AWS_KEY=""
AWS_SECRET=""
S3_BUCKET=""
S3_BUCKET_PATH="/"
S3_ACL="x-amz-acl:private"
function s3Upload
{
path=$1
@pedrouid
pedrouid / webcrypto-examples.md
Created December 15, 2018 01:07
Web Cryptography API Examples
@mjm918
mjm918 / client.py
Created December 15, 2018 09:56
Python socket programming AES CBC encryption
import socket
import os
import threading
import hashlib
from Crypto import Random
import Crypto.Cipher.AES as AES
from Crypto.PublicKey import RSA
import signal
from lazyme.string import color_print
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>HKAtrialFibrillationDetectionOnboardingCompleted</key>
<integer>1</integer>
<key>HKElectrocardiogramOnboardingCompleted</key>
<integer>3</integer>
</dict>
</plist>
@Mefistophell
Mefistophell / RUST.MD
Last active February 4, 2025 17:11
How to Compile a Rust Program on Mac for Windows

Question: I want to compile my Rust source code for the Windows platform but I use macOS.

Solution:

  1. Install target mingw-w64: brew install mingw-w64
  2. Add target to rustup: rustup target add x86_64-pc-windows-gnu
  3. Create .cargo/config
  4. Add the instructions below to .cargo/config
[target.x86_64-pc-windows-gnu]
import React from 'react';
function Parent(){
const data = 'Data from parent';
return(
<div>
<Child dataParentToChild = {data}/>
</div>
)
}
import React from 'react';
class Parent extends React.Component{
constructor(props){
super(props);
this.state = {
data: null
}
}
@gaelanlloyd
gaelanlloyd / gist:0677759fd4dc0f58e1e7449784bb8903
Last active November 27, 2024 19:10
Example nftables.conf
#!/usr/sbin/nft -f
#
# This config was adapted from various sources.
#
# Use at your own risk. Learn what each rule does
# prior to implementing in your environment.
#
flush ruleset
@chrislambe
chrislambe / FontAwesomeSvgIcon.tsx
Created August 31, 2020 18:35
Font Awesome icon component for Material UI
import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
import SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon';
import makeStyles from '@material-ui/styles/makeStyles';
import React, { forwardRef } from 'react';
type Props = Omit<SvgIconProps, 'viewBox'> & {
icon: IconDefinition;
};
const useStyles = makeStyles({