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
-- set output to csv | |
.output me_to_andy.csv | |
-- query (date, text) from me to andy | |
-- you need to find out which handle_id is relevant to your query | |
select datetime(date_delivered + strftime('%s', '2001-01-01 00:00:00'), 'unixepoch', 'localtime') as date, text from message where handle_id = 175 AND is_from_me = 1; | |
-- set output to terminal stdout | |
.output stdout |
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
<script type="text/javascript"> | |
// This will parse a delimited string into an array of | |
// arrays. The default delimiter is the comma, but this | |
// can be overriden in the second argument. | |
function CSVToArray( strData, strDelimiter ){ | |
// Check to see if the delimiter is defined. If not, | |
// then default to comma. | |
strDelimiter = (strDelimiter || ","); |
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
import UIKit | |
class GradientView: UIView { | |
override class func layerClass() -> AnyClass { | |
return CAGradientLayer.self | |
} | |
func initGradient() { |
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
-- Add isOnVacation | |
alter table onVacation | |
add isOnVacation bit; | |
-- compute column values | |
update onVacation | |
set isOnVacation=1 | |
where CURDATE() > onVacation.start AND CURDATE() < onVacation.end; | |
set @listOfids=(select id from onVacation where isOnVacation=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
// in home controller | |
[HttpPost] | |
public ActionResult createQuestion(FormCollection form, int missionID) | |
{ | |
// get question text from form | |
string question_text = form["Question"].ToString(); | |
// lookup current user in database to get userID | |
var currentUserEmail = User.Identity.Name; | |
User user = db.Users.Where(u => u.UserEmail == currentUserEmail); |
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
<div class="dropdown"> | |
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"> | |
Missions | |
<span class="caret"></span> | |
</button> | |
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1"> | |
<!-- clicking on Missouri St. Louis takes me to the Mission action method and passes the name parameter --> | |
<li><a href="Mission?name=Missouri">Missouri St. Louis</a></li> |