Skip to content

Instantly share code, notes, and snippets.

Hugh Yar yar00001

Block or report user

Report or block yar00001

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
@yar00001
yar00001 / iterm2-solarized.md
Created Jun 22, 2019 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)
View iterm2-solarized.md

Default

Default

Powerlevel9k

Powerlevel9k

View sample.py
import boto3
from io import BytesIO
from gzip import GzipFile
import re
BUCKET_NAME = 'bucket_name'
PREFIX = 'RMS-DB/Device/2019/05/09/'
KMS_KEY_ID = 'arn:aws:kms:us-east-1:something:key/something'
VALID_FORMAT = '|||||'
View gist:c53ce1b652de7fb1ddce6ca0bf609876
package Company_based.Amazon.firstquestion.codeToRead;
import org.junit.Test;
import java.util.Stack;
/**
* 1- two pointers
* 2- stack
*/
View ABStringGenerator.java
/**
* https://arena.topcoder.com/?fbclid=IwAR2AvwfSd16RJinXVzPYsYHW6zxs99mbT6zo25tVgxsTmL5EIArjS1HgPho#/u/practiceCode/16319/46378/13642/1/325040
*/
public class ABStringGenerator {
public String generateABString(int n, int k) {
// ToDo: add null/edge check
// Get the order
PriorityQueue<Integer> queue = findSegments(n, k);
@yar00001
yar00001 / email-generator.js
Last active Jun 4, 2018
Copies a random Email Address to clipboard
View email-generator.js
/**
* 1. Create bookmark.
* 2. Edit bookmark URL(Chrome) / Location(Firefox) and copy the code.
*/
javascript:(function(){
var el = document.createElement('textarea');
var mult = 99999999;
var emailAddress = "yarhooma+" + Math.floor(Math.random() * mult) + "@amazon.com";
el.value = emailAddress;
@yar00001
yar00001 / Program.cs
Created Mar 25, 2017
RSA Encrypt/Decrypt
View Program.cs
using System;
using System.Security.Cryptography;
using System.Text;
namespace ConsoleApp1
{
class Program
{
private static RSAParameters PublicKey { get; set; }
View TCPAnalogReadme.md

View this file on GIST

TCPAnalog

How to run:

  • You need to run "networkLayer", using defined arguments:
    python networkLayer.py port maxNoPackets delay probDrop probMangle
    
@yar00001
yar00001 / README.md
Last active Sep 29, 2016
A TCP-Based DNS Simulator written in Java
View README.md

TCP-Based DNS Simulator

open this md file at gist

How to use:

  • Run the Server-Side code.
  • Do the queries using the Client-Side code.
  • Use q to quit from the Client-Side. The Server-Side part shuts down using exit command (on the server-side cl).

How it works:

  • New valid queries will be cached in DNS_MAPPING.txt located in root of the project. If the file doesn't exit it will be generated.
@yar00001
yar00001 / Leet_239.java
Created Aug 25, 2016
Sliding Window Maximum
View Leet_239.java
package LeetCode;
import org.junit.Assert;
import org.junit.Test;
import java.util.Comparator;
import java.util.PriorityQueue;
/**
Given an array nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sliding window moves right by one position.
@yar00001
yar00001 / Leet_236.java
Created Aug 25, 2016
Lowest Common Ancestor of a Binary Tree
View Leet_236.java
package LeetCode;
import org.junit.Assert;
import org.junit.Test;
import java.util.ArrayList;
import java.util.Stack;
import Helper.Helper.*;
/*
You can’t perform that action at this time.