This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include "linked-list.h" | |
#define ASSERT_TRUE(cond) { \ | |
if (!(cond)) { \ | |
fprintf(stderr, "%s: " #cond " assertion failed\n", __func__); \ | |
} \ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(){document.body.appendChild(document.createElement('script')).src='https://gist.github.com/allareri/7685975/raw/68a4f0636aa052912b7b575ab6dfbb9300a6b5df/twitter-bookmarklet.js';})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function refreshFeed(){ | |
var linkToClick= document.getElementsByClassName("new-tweets-bar")[0] | |
if(linkToClick != undefined){ | |
linkToClick.click() | |
} | |
} | |
setInterval(refreshFeed, 500) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//------------------------------------------------------------------------------------------------------------------ | |
// 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: [], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
NewerOlder