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 following command works for downloading when using Git for Windows: | |
# curl -LOf http://gist.githubusercontent.com/kmorcinek/2710267/raw/.gitignore | |
# | |
# Download this file using PowerShell v3 under Windows with the following comand: | |
# Invoke-WebRequest https://gist.githubusercontent.com/kmorcinek/2710267/raw/ -OutFile .gitignore | |
# | |
# or wget: | |
# wget --no-check-certificate http://gist.githubusercontent.com/kmorcinek/2710267/raw/.gitignore | |
# User-specific files |
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
/* | |
Thanks @seri & others (from the Rust Discord) for the help! | |
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=2e1705d582a07f1d59897a21ae2421d6 | |
- no more realloc of all of the args into a vec if you just want the second one | |
- or_else to call get_zipcode_from_user if the arg is not present, ok() to convert a result into an option | |
- return a result | |
- ? for fast return in case of an error | |
https://doc.rust-lang.org/std/option/enum.Option.html#method.or_else |
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 | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
) | |
func handler(w http.ResponseWriter, r *http.Request) { | |
fmt.Fprintf(w, "Hi there, I love %s!", r.URL.Path[1:]) |
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
using System; | |
namespace learning | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
// Make myCar | |
Car myCar = new Car(); |
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
// https://dev.to/moficodes/build-your-first-rest-api-with-go-2gcj | |
package main | |
import ( | |
"log" | |
"net/http" | |
) | |
type server struct{} |
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 Cashier Program | |
A simple program that accepts two user inputs: | |
1) The total the customer owes | |
2) The amount in cash the customer paid with | |
This program returns the most effiecient option for giving change back to the customer. | |
*/ |
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
const http = require('http'); | |
const hostname = '127.0.0.1'; | |
const port = 3000; | |
const server = http.createServer(function (req, res) { | |
res.statusCode = 200; | |
res.setHeader('Content-Type', 'text/plain'); | |
res.end('Hello, World!\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
using System; | |
using System.Xml.Serialization; | |
using System.IO; | |
namespace SerializeTester | |
{ | |
public class Runner | |
{ | |
static void Main(string[] args) | |
{ |
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 <SDL.h> | |
#include <stdio.h> | |
const int SCREEN_WIDTH = 640; | |
const int SCREEN_HEIGHT = 480; | |
int main(int argc, char* args[]) | |
{ | |
SDL_Window* window = NULL; | |
SDL_Surface* screenSurface = NULL; |
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
// A very inefficient way to remove everything from a file except for letters and newlines. | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
string text = System.IO.File.ReadAllText(@"original-file.txt"); | |
string newText = ""; | |
for (int i = 0; i < text.Length; i++) { | |
if (Char.IsLetter(text, i) || text[i] == '\n') { |
NewerOlder