Skip to content

Instantly share code, notes, and snippets.

View hugomosh's full-sized avatar
🎈
Balance

Hugo Mosh Cardoza hugomosh

🎈
Balance
  • Google
  • Mountain View, California
  • X @hugomosh
View GitHub Profile
@hugomosh
hugomosh / AppDelegate.m
Last active May 15, 2017 01:22
Different port for react native bundler
...
#ifdef DEBUG
jsCodeLocation = [NSURL URLWithString:@"http://localhost:9988/index.ios.bundle?platform=ios&dev=true"];
#else
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];
#endif
...
...
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];
...
@hugomosh
hugomosh / utilProps.jsx
Created January 29, 2018 15:07
Utils For Reac Native
const emailTextFieldProps = {
keyboardType={"email-address"}
autoCapitalize={"none"}
value={this.state.email}}
@hugomosh
hugomosh / copyFromCsvToPSQL
Created June 5, 2018 04:54
Copy from csv to update Table PSQL
psql -h <dbhost> -U <user> -d <dbName>
CREATE TEMP TABLE tmp_x (venue_id int, address1 text);
CREATE TEMP TABLE tmp_x (id int, columnToUpdate text);
\copy tmp_x FROM '/absolute/path/to.csv' with (format csv,header true, delimiter ',');
UPDATE original_table
SET columnToUpdate = tmp_x.columnToUpdate
FROM tmp_x
WHERE original_table.id = tmp_x.id;