Skip to content

Instantly share code, notes, and snippets.

View farhanpatel's full-sized avatar

Farhan farhanpatel

View GitHub Profile
@farhanpatel
farhanpatel / gist:2772973
Created May 23, 2012 02:43
sample classes
{
coursesData = (
{
courseNumber = "\nMBB 231";
detailName = "Cellular Biology and Biochem.";
infoData = (
{
days = Fri;
endTime = "1970-01-01 19:20:00 +0000";
location = "TASC2-8070";
@farhanpatel
farhanpatel / gist:b21d8266e16b026423de
Created November 19, 2014 02:43
beaglebone uenv.txt for StarterWare
uenvcmd=setenv autoload no;dhcp;setenv loadaddr 0x80000000;setenv serverip 192.168.1.114;setenv tftproot /Users/farhan/cmpt433tftp;setenv bootfile ${tftproot}/download.bin;tftp ${loadaddr} ${bootfile};echo *** Booting to BareMetal ***; go ${loadaddr};
@farhanpatel
farhanpatel / a_mongodb_to_s3_backup.sh
Last active September 2, 2015 18:24 — forked from lazarofl/a_mongodb_to_s3_backup.sh
MongoDB Automatic Backup to Amazon S3 with Crontab and s3cmd.Red Hat Linux on Amazon EC2
#!/bin/bash
MONGODUMP_PATH="/opt/local/bin/mongodump"
MONGO_HOST="localhost"
MONGO_PORT="27017"
MONGO_DATABASE="paigeeworld_main"
TIMESTAMP=`date +%F-%H%M`
S3_BUCKET_NAME="paigeeworld-backup"
class: center, middle
# Title
---
# Agenda
1. Introduction
2. Deep-dive
SELECT *, metadataDB.page_metadata.title AS metadata_title
FROM
(
SELECT * , id as historyID, max(length(url)),
(SELECT count(1) FROM visits WHERE visits.siteID = history.id) as visitCount
FROM history WHERE id IN (
SELECT DISTINCT siteID AS historyID
FROM visits WHERE date > 1491243277100158
AND NOT EXISTS (SELECT * FROM visits WHERE siteID = historyID AND date > 1493055877100158)
var extraEvents: [String: Any] = [:]
if let paramEvents = extra {
extraEvents = extraEvents.merging(paramEvents) { (_, new) in new }
}
if let extraString = description {
extraEvents = extraEvents.merging(["errorDescription": extraString]) { (_, new) in new }
}