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
// | |
// ViewController.swift | |
// citizencrossfit | |
// | |
// Created by Mark Jackson on 17/11/2014. | |
// Copyright (c) 2014 Mark Jackson. All rights reserved. | |
// | |
import UIKit | |
import Alamofire |
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
// | |
// ViewController.swift | |
// VideoBackground.swift | |
// | |
// Created by Peng Jin on 25/7/14. | |
// Copyright (c) 2014 elvinjin. All rights reserved. | |
// | |
import UIKit |
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
// | |
// CitizenViewController.swift | |
// citizencrossfit | |
// | |
// Created by Mark Jackson on 19/11/2014. | |
// Copyright (c) 2014 Mark Jackson. All rights reserved. | |
// | |
import UIKit |
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
#http://superuser.com/a/322365 | |
#lsof -t -i:4444 | |
kill `lsof -t -i:4444` |
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://www.digitalocean.com/community/tutorials/how-to-use-a-simple-bash-script-to-restart-server-programs | |
#!/bin/sh | |
ps auxw | grep apache2 | grep -v grep > /dev/null | |
if [ $? != 0 ] | |
then | |
/etc/init.d/apache2 start > /dev/null | |
fi |
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 | |
#NOTE: USE `bash launch` not `sh launch` | |
timestamp(){ | |
(date) | |
} | |
server_name="schedules-backend" | |
log_file="crash_log.txt" | |
server_log="server_log.txt" | |
time=$(timestamp) | |
crash_message="Restarting server. Logging scripted restart. (Add successful restart log);\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
#!/bin/bash | |
if [ $# -ge 2 ] | |
then | |
bash ~/launch.sh -k | |
if [ "$2" == "-f" ] | |
then | |
rm -r $1/ | |
git clone https://github.com/jacks205/$1.git | |
cd ~/$1 && npm install | |
cp ~/local.js ~/$1/config/ |
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
static int[] bubblesort(int[] numbers) | |
{ | |
int tempVar; | |
for (int i = 0; i < numbers.length; i++) | |
{ | |
for(int j = 0; j < numbers.length; j++) | |
{ | |
if(numbers[i] > numbers[j + 1]) | |
{ | |
tempVar = numbers [j + 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
def main(): | |
# length of unsigned 16 bit int | |
length = 65535 | |
# keep count of how many palindromic numbers there are | |
count = 0 | |
# loop through entire range | |
for i in range(0,length): | |
#cast i to a string and compare reverse | |
if(str(i) == reverseString(str(i))): | |
count += 1 |