Skip to content

Instantly share code, notes, and snippets.

package main
func packetDescrambler(seq []int, fragmentData []string, n int) string {
maxSeqIdx := func(numSlice []int) int {
max := numSlice[0]
for _, n := range numSlice[1:] {
if n > max {
max = n
}
}
@ezy023
ezy023 / lossless-compression.go
Created January 29, 2021 00:12
Solution to lossless-compression problem
func losslessDataCompression(inputString string, width int) string {
result := ""
var i int = 0
for i < len(inputString) {
end := i + 1
var begin int
if i < width {
begin = 0
} else {
begin = i - width
#include <stdio.h>
#include <stdlib.h>
#include "linked-list.h"
#define ASSERT_TRUE(cond) { \
if (!(cond)) { \
fprintf(stderr, "%s: " #cond " assertion failed\n", __func__); \
} \
}
javascript:(function(){document.body.appendChild(document.createElement('script')).src='https://gist.github.com/allareri/7685975/raw/68a4f0636aa052912b7b575ab6dfbb9300a6b5df/twitter-bookmarklet.js';})();
function refreshFeed(){
var linkToClick= document.getElementsByClassName("new-tweets-bar")[0]
if(linkToClick != undefined){
linkToClick.click()
}
}
setInterval(refreshFeed, 500)
#!/bin/sh
# Install Homebrew
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
# Make dotfiles directory
# mkdir ~/Documents/dofiles
DIRECTORY="/Users/$USER/Documents/dotfiles"
if [ ! -d $DIRECTORY ]; then
mkdir $DIRECTORY
@ezy023
ezy023 / output
Last active December 25, 2015 06:59
The row string is 396240001
The col string is 000003000
The box string is 396240001
The all string is 396240001000003000396240001
The row string is 39624�001
The col string is 003000080
The box string is 39624�001
The all string is 39624�00100300008039624�001
The row string is 39624�501
The col string is 009401530
require 'csv'
# ["id", "first_name", "last_name", "email", "phone", "created_at"]
class Person
attr_reader :first_name, :last_name, :email
def initialize(attributes)
@id = attributes["id"]
@first_name = attributes["first_name"]
@last_name = attributes["last_name"]
@email = attributes["email"]
@ezy023
ezy023 / zoo.js
Last active December 17, 2015 16:09 — forked from dbc-challenges/zoo.js
//------------------------------------------------------------------------------------------------------------------
// YOUR CODE: Create your Zoo "object literal" and Animal "constructor" and "prototypes" here.
//------------------------------------------------------------------------------------------------------------------
function Animal(name, num_legs){
this.num_legs = num_legs;
this.name = name
};
var Zoo = {
animals: [],
@ezy023
ezy023 / index.html
Last active December 17, 2015 16:09 — forked from dbc-challenges/index.html
DBC Phase 2 Practice Assessment Part 3
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="http://cdn.jsdelivr.net/normalize/2.1.0/normalize.css">
<link rel="stylesheet" href="main.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Lato:100,900">
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/3.0.2/css/font-awesome.min.css">
</head>