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
/* | |
I was able to achieve these speeds on my laptop: Intel Core i7-4500U @ 1.80GHZ | |
Test 1: 664579 took 56ms | |
Test 2: 5761455 took 702ms | |
Test 3: 50847534 took 9.062s | |
*/ | |
public class PrimeCounter { | |
public static void main(String[] args) { | |
int[] times = new int[]{10000000, 100000000, 1000000000}; |
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" | |
"os" | |
"strings" | |
"time" |
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/bash | |
### ——————————————————————– ### | |
# This script creates a text file that contains all the current permissions | |
# of the entire linux system. | |
# Run: sudo bash get_all_permissions.sh | |
# Location: http://virtualparadise.wordpress.com/2010/04/29/linux-repair-permissions |
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
############################################################################### | |
# New Server - AWS | |
############################################################################### | |
# Update software | |
sudo apt-get update | |
sudo apt-get upgrade | |
# Install Apps | |
sudo apt-get install unzip |
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
// Source: https://gist.github.com/tdegrunt/045f6b3377f3f7ffa408 | |
// Example: replaceall.exe -find="cordove" -replace="gowebapp" -extension="*.go" -filename=true -write=false | |
package main | |
import ( | |
"flag" | |
"fmt" | |
"io/ioutil" |
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 | |
/* | |
Run and it will create appmaster.exe which will create a new appworker.exe if it is shutdown. | |
Must delete appmaster.exe before each run. | |
Only tested on Windows. | |
Should build with: -ldflags -H windowsgui | |
*/ | |
import ( |
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
{ | |
"Database": { | |
... | |
"MongoDB": { | |
"URL": "127.0.0.1", | |
"Database": "gowebapp" | |
} | |
}, | |
... | |
} |
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 ( | |
"encoding/json" | |
"flag" | |
"io" | |
"io/ioutil" | |
"log" | |
"os" | |
) |
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
# Find all files containing text | |
grep -Ril "text to find" / | |
# Write test to file using sudo | |
echo 'This is the test.' | sudo tee /etc/configfile | |
# Send a log using curl | |
curl -X POST -T file.txt https://example.com/file_upload; | |
# Check supported ciphers on server |
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
// | |
// GameScene.swift | |
// Flappy Bird | |
// | |
// Created on 4/20/16. | |
// Copyright (c) 2016 Joseph Spurrier. All rights reserved. | |
// | |
import SpriteKit |