This file contains hidden or 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 'httparty' | |
require 'minitest/autorun' | |
require 'minitest/mock' | |
class GoogleClient | |
BASE_URI = "http://google.com" | |
attr_writer :http_client |
This file contains hidden or 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
import java.util.*; | |
public class Set { | |
private List values = new ArrayList(); | |
public Set(int[] inputSet) { | |
for (int i = 0; i < inputSet.length; i++) { | |
boolean exists = values.contains(inputSet[i]); | |
if (!exists) { | |
this.values.add(inputSet[i]); |
This file contains hidden or 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
# https://projecteuler.net/problem=1 | |
# sum the nautural numbers below 10 that are multiples of 3 or 5 | |
.section .text | |
.globl _start | |
_start: | |
pushl $1 # counter | |
pushl $0 # sum |
This file contains hidden or 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 'httparty' | |
require 'json' | |
module Pipedrive | |
class Client | |
def initialize(api_token) | |
self.api_token = api_token | |
end |
This file contains hidden or 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
/* You can successfully authenticate to this program by entering the password | |
* as seen in the code below, or by doing something else. What is it and why? | |
* | |
* $ make good_enough_password | |
* $ ./good_enough_password | |
* Enter password: | |
* | |
* Hint: The problem is worse on a 32bit platform. To compile for 32bit on OSX | |
* $ cc -m32 -o good_enough_password good_enough_password.c | |
* $ ./good_enough_password |
This file contains hidden or 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
/* Welcome freedom fighter. The liberation front has gained access to the | |
* source code for a wire transfer program used by FIRST NATIONAL CYBER, a | |
* bank used by the alliance for oppression and we need you to find a | |
* vulnerability in this program and stea... er liberate the funds from an | |
* operative named prince_john. | |
* | |
* The bank programmers have attempted to put in a number of defensive checks | |
* to prevent abuse of the bank wire network, and we cannot modify the | |
* program source code without risking detection but we suspect that deadlines | |
* and corporate training programs have left them without the motivation |
This file contains hidden or 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 following program is an example of a setup program which generates a | |
* secret key and writes it to a file which is only readably by the owner of | |
* the file. | |
* | |
* In this example the program should be made owned by root and the wheel group | |
* and the suid (set user ID) permission should be set so that when a regular | |
* user runs the program, the secrets.txt file will be created and owned by the | |
* root user. | |
* | |
* Your goal is to try to find a way without modifying the code of the program |
This file contains hidden or 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
Cape South Mobile Home Park | |
West Melbourne | |
Mintons Corner | |
June Park | |
Melbourne Village | |
Quail Run Mobile Home Estates | |
The Lakes of Melbourne Mobile Home Park | |
Lakes of Melbourne Mobile Home Park | |
Melbourne Gardens | |
Trailer Haven Mobile Home Park |
This file contains hidden or 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
/* Problem */ | |
class Thing { | |
// testing this will result in expensive calls to event logs and database | |
public int dostuff() { | |
int result = something(); | |
EventLogsAndDatabaseLogger.log(1, 2, 3, 4, 5, "message"); | |
return result; | |
} |
This file contains hidden or 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
extern crate hyper; | |
extern crate time; | |
use hyper::Url; | |
use hyper::client::*; | |
use std::fs::File; | |
use std::io::BufRead; | |
use std::io::BufReader; | |
use std::sync::{Arc, Mutex}; | |
use std::thread; |