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
<?php | |
error_reporting (0); | |
//debug or test backend.php by running the following commands from the browser: | |
//your.ip.address/backend.php?debug=true&action=select | |
//your.ip.address/backend.php?debug=true&action=login&[email protected] | |
//your.ip.address/backend.php?debug=true&action=busy&[email protected] | |
$fp = fopen("log.txt","a"); | |
fwrite($fp,print_r($_POST,1)."\n"); |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="robots" content="index, follow"> | |
<title>Untitled</title> | |
<meta name="author" content=""> | |
<meta name="description" content=""> |
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
<?php | |
//Get html from a summary email list on banner. | |
//If it's multiple pages, just append each page into one file | |
// | |
$file = file("student_emails.txt"); | |
$fp = fopen("3013_distribution_list.csv","w"); | |
fwrite($fp,"name,display name,email address\n"); | |
for($i=0;$i<sizeof($file);$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
import csv | |
my_csv_file = open('/tmp/sample.csv', 'w') | |
csv_writer = csv.writer(my_csv_file) | |
sample_row = ('Michael', 1234, 23.46, 'San Francisco, California') | |
# Write a CSV row | |
csv_writer.writerow(sample_row) | |
# Result: Michael,1234,23.46,"San Francisco, California" |
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 Foundation | |
class File { | |
class func exists (path: String) -> Bool { | |
return NSFileManager().fileExistsAtPath(path) | |
} | |
class func read (path: String, encoding: NSStringEncoding = NSUTF8StringEncoding) -> String? { | |
if File.exists(path) { |
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
youtube-dl --extract-audio --audio-format mp3 <video URL> | |
youtube-dl -i "<Youtube URL>" -o "%(title)s.%(ext)s" --extract-audio --audio-format "mp3" --audio-quality "192k" |
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 UIKit | |
import CoreLocation | |
class CurrentLocationViewController: UIViewController, CLLocationManagerDelegate { | |
let locationManager = CLLocationManager() | |
var location: CLLocation? | |
override func viewDidAppear() { |
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
<?php | |
// Usage: php convert-avi-mpg.php nameofdir | |
$dirName = $argv[1]; | |
//Make sure directory has trailing slash | |
$dirName = rtrim($dir,"/"); | |
$dir = scandir($dirName); |
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
var nums = [44,55,33,43,56,54,87,67,12,34,32,89] | |
println(nums[4]) | |
func OrderedList(Nums:[Int])->[Int]{ | |
var ONums:[Int] = [] | |
for val in Nums{ |
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
<?php | |
//convert -background white -fill black -font /Library/Fonts/Courier\ New\ Bold.ttf -pointsize 24 label:A -gravity center A.png | |
$sizes = array(); | |
for($i=12;$i<=64;$i+=2){ | |
$sizes[] = $i; | |
exec("mkdir letters_lower_{$i}"); |