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 'dart:convert'; | |
| void main() { | |
| var jsonString = ''' | |
| [ | |
| { | |
| "PortalID": "WZPORP", | |
| "Name": "Smet's Place" | |
| } | |
| ] |
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 string | |
| import multiprocessing | |
| import urllib.request | |
| import urllib.parse | |
| url = "http://natas15.natas.labs.overthewire.org/index.php" | |
| headers = { | |
| "Authorization": ( | |
| "Basic bmF0YXMxNTpBd1dqMHc1Y3Z4clppT05nWjlKNXN0TlZrbXhkazM5Sg==" | |
| ), |
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
| #!/bin/bash | |
| for REPO in $(cat repos.txt); do git clone https://github.com/joerocca/$REPO.git; done |
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
| // | |
| // WrappingStaticSpacingFlowLayout.swift | |
| // Freetime | |
| // | |
| // Created by Joe Rocca on 12/7/17. | |
| // Copyright © 2017 Ryan Nystrom. All rights reserved. | |
| // | |
| import Foundation |
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
| func bubbleSort<T: Comparable>(array: inout Array<T>) { | |
| var swapped: Bool | |
| repeat { | |
| swapped = false | |
| for i in 0..<array.count - 1 { | |
| if (array[i] > array[i+1]) { | |
| swap(&array[i], &array[i+1]) | |
| swapped = true | |
| } | |
| } |
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
| // (c) 2015 Nate Cook, licensed under the MIT license | |
| // | |
| // Fisher-Yates shuffle as protocol extensions | |
| extension Collection { | |
| /// Return a copy of `self` with its elements shuffled | |
| public func shuffle() -> [Generator.Element] { | |
| var list = Array(self) | |
| list.shuffleInPlace() | |
| return list |
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
| defmodule TestProject.Repo.Migrations.CreatePost do | |
| use Ecto.Migration | |
| def change do | |
| create table(:posts) do | |
| add :title, :string | |
| add :description, :text | |
| timestamps() | |
| 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
| let numbers = [54, 82, 34, 62, 24, 74] | |
| let result = numbers.filter{$0 <= 50}.reduce(0, +) |
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
| let numbers = [8, 24, 85, 12, 54, 23] | |
| let sorted = numbers.sorted(by: >) |
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
| let numbers = [9, 3, 7, 10, 22, 50] | |
| let total = numbers.reduce(4, +) |
NewerOlder