Skip to content

Instantly share code, notes, and snippets.

View jamesguan's full-sized avatar
🏠
Working from home

James Guan jamesguan

🏠
Working from home
  • San Francisco, California
View GitHub Profile
@jamesguan
jamesguan / react-native-issues.txt
Last active January 15, 2019 20:35
Fix React Native Issues
If missing config.h file:
1. Go to the node modules folder
cd node_modules/react-native/third-party/glog-{X}.{X}.{X}/
2. Run the config script:
./configure
Change to release mode:
Product -> Scheme -> Edit Scheme and then select Debug under Build
Xcode 10 issue:
@jamesguan
jamesguan / windowstricks.txt
Last active January 3, 2019 02:54
Windows Tricks
Open the Run
Run the following command
shell:AppsFolder
https://answers.microsoft.com/en-us/windows/forum/windows_10-windows_store/starting-windows-10-store-app-from-the-command/836354c5-b5af-4d6c-b414-80e40ed14675
@jamesguan
jamesguan / postgres.txt
Created December 16, 2018 00:32
Postgres Instructions
https://www.linode.com/docs/databases/postgresql/how-to-install-postgresql-relational-databases-on-centos-7/
@jamesguan
jamesguan / gist:4c7c2e00038c0b257059b36b8271a269
Created October 5, 2018 02:30
How to remove the osxkeychain from git credentials
Do
You may try the following but may not succeed:
git config --local --unset credential.helper
git config --global --unset credential.helper
git config --system --unset credential.helper
On Mac, the configuration is stored in:
/Library/Developer/CommandLineTools/usr/share/git-core/gitconfig
@jamesguan
jamesguan / servers_alive.txt
Created September 2, 2018 00:26
Keep servers alive
Keeping things alive with:
screen
@jamesguan
jamesguan / enable_airdrop.sh
Last active August 30, 2018 15:32
enable airdrop on Mac
Enable airdrop: defaults write com.apple.NetworkBrowser DisableAirDrop -bool NO
Disable airdrop: defaults write com.apple.NetworkBrowser DisableAirDrop -bool YES
https://answers.uillinois.edu/page.php?id=56564
@jamesguan
jamesguan / bash_commands.sh
Created May 18, 2018 19:14
Some cool bash commands
# To look at the start of the file
head -(whatever number here) filename
@jamesguan
jamesguan / mongodbstuff.txt
Last active May 8, 2018 04:04
Installing/upgrading and uninstalling mongodb on centos 7
// Commands:
mongod --version // Check version
which mongo // Check where mongo is
// Locations:
Logs are stored in /var/log/mongodb
Something is stored in /var/lib/mongo
Installing
// Go to:
@jamesguan
jamesguan / searchfilter.pipe.ts
Last active May 7, 2018 21:26
Angular 2+ Search Pipe
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({name: 'searchFilter'})
export class SearchFilterPipe implements PipeTransform {
iterate(obj, searchText) {
for (let property in obj) {
if (obj.hasOwnProperty(property)) {
if (typeof obj[property] === "object") {
if (this.iterate(obj[property], searchText)){
return true;
}
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\PowerShellAsAdmin]
@="Open PowerShell window here as administrator"
"Extended"=""
"HasLUAShield"=""
"Icon"="powershell.exe"
[HKEY_CLASSES_ROOT\Directory\Background\shell\PowerShellAsAdmin\command]
@="C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe -windowstyle hidden -Command \"Start-Process powershell -ArgumentList '-NoExit', '-Command cd %V' -Verb runAs\""