Skip to content

Instantly share code, notes, and snippets.

//
// ViewController.swift
// feelsappv1
//
// Created by Varshil Patel on 2/23/19.
// Copyright © 2019 Varshil Patel. All rights reserved.
//
import UIKit
import HealthKit // import this at the top of the file
@wesleyzhao
wesleyzhao / sendwrite.py
Created November 28, 2011 05:56
SendWrite Python
# first install 'requests' in terminal
# > pip install requests
# now the python code
import requests
auth_info = ('api', 'YOUR_API_KEY')
data = {
'title' : 'A new card sent by robots',
'message' : ' Humans, prepare to be invaded',
@wesleyzhao
wesleyzhao / student_scores.txt
Created November 10, 2011 02:33
Student test scores
Joe: 88,78,100,68,94,81,85,87,90,82
Kim: 91,87,85,83,96,81,90,98,94,92
Alex: 73,98,99,84,72,75,87,81,95,85
Sam: 93,91,90,97,94,82,98,99,95,96
@wesleyzhao
wesleyzhao / logfile
Created October 24, 2011 01:41
console rvm error
wesley@wesley-T5020:~$ rvm install 1.9.2
Installing Ruby from source to: /usr/share/ruby-rvm/rubies/ruby-1.9.2-p180, this may take a while depending on your cpu(s)...
ruby-1.9.2-p180 - #fetching
ruby-1.9.2-p180 - #extracted to /usr/share/ruby-rvm/src/ruby-1.9.2-p180 (already extracted)
ruby-1.9.2-p180 - #configuring
ruby-1.9.2-p180 - #compiling
ERROR: Error running 'make ', please read /usr/share/ruby-rvm/log/ruby-1.9.2-p180/make.log
ERROR: There has been an error while running make. Halting the installation.
@wesleyzhao
wesleyzhao / grant-mysql-user-access
Created July 16, 2011 09:14
granting mysql user access
ubuntu@ec2:~$ mysql -u root -p
Enter password: #put your password here
mysql> grant all on *.* to 'root'@'%' IDENTIFIED BY 'securepassword';
@wesleyzhao
wesleyzhao / move_stuff
Created July 14, 2011 10:15
moving stuff
#from ~/ssl_stuff
mv myserver.key /etc/ssl/private
mv mydomain_com.crt /etc/ssl/certs
mv mydomain_com.ca-bundle /etc/ssl/certs
@wesleyzhao
wesleyzhao / 443_switch
Created July 14, 2011 09:47
switch to 443
#from /etc/apache2/sites-enabled/000-default
<VirtualHost *:443>
...
...
</VirtualHost>
@wesleyzhao
wesleyzhao / add_apache_redirect
Created July 14, 2011 09:44
redirect http to https
#from /etc/apache2/httpd.conf
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
@wesleyzhao
wesleyzhao / vhost_ssl
Created July 14, 2011 09:29
doing virtual host ssl
#from /etc/apache2/sites-enabled/000-default
<VirtualHost *:80>
...
...
SSLEngine on
SSLCertificateKeyFile /etc/ssl/private/myserver.key
SSLCertificateFile /etc/ssl/certs/mydomain_com.crt
SSLCertificateChainFile /etc/ssl/certs/mydomain_com.ca-bundle
@wesleyzhao
wesleyzhao / prompts
Created July 14, 2011 09:19
generating csr prompts
Country Name (2 letter code) [AU]: US
State or Province Name (full name) [Some-State]: Washington
Locality Name (eg, city) []: Seattle
Organization Name (eg, company) [Internet Widgits Pty Ltd]: Herp and Co
Organizational Unit Name (eg, section) []: Herping
Common Name (eg, YOUR name) []: mydomain.com
Email Address []:
A challenge password[]:
An optional company name[]: