Skip to content

Instantly share code, notes, and snippets.

#import "My_Objective_C_Project-Swift.h"
@implementation MyObjectiveCClass
+ (void)doSomething {
[MySwiftClass doSomething];
}
@end
import Foundation
@objc class MySwiftClass : NSObject {
@objc public class func doSomething() {
NSLog("Here I am!");
}
}
#!/bin/sh
if [ $# -eq 0 ]; then
echo "Usage: sh spectrify.sh
<Table to export in format: schemaname.tableName>
<Should create schema: true/false>
<Should create table: true/false>
<Should truncate Redshift table: true/false>"
fi
select * from mv_events_count;
REFRESH MATERIALIZED VIEW mv_events_count;
CREATE MATERIALIZED VIEW mv_events_count AS
SELECT * FROM dblink('rds_redshift', $REDSHIFT$
SELECT count(*)
FROM events;
$REDSHIFT$) AS t1 (c int);
SELECT * FROM dblink('rds_redshift', $REDSHIFT$
SELECT count(*)
FROM events;
$REDSHIFT$) AS t1 (c int);
CREATE SERVER rds_redshift FOREIGN DATA WRAPPER postgres_fdw
OPTIONS (host '<redshift_ip_address>', port '5439', dbname '<redshift_db_dname>', sslmode 'require');
CREATE USER MAPPING FOR <rds_user_name> SERVER rds_redshift
OPTIONS (user '<redshift_user_name>', password '<redshift_user_password>');
CREATE EXTENSION postgres_fdw;
CREATE EXTENSION dblink;
@deepshah7
deepshah7 / podcast-ratings.php
Created February 18, 2020 08:36 — forked from sgmurphy/podcast-ratings.php
Scrape ratings from iTunes store
<?php
/**
* Scrape the number of podcast reviews from iTunes for all country specific storefronts.
*
* @author Sean Murphy <sean@iamseanmurphy.com>
*/
$podcast_id = '366931951'; // Startups For the Rest of Us
//$podcast_id = '318567721'; // techzing