Skip to content

Instantly share code, notes, and snippets.

View peter-mach's full-sized avatar
🎯
Focusing

Peter peter-mach

🎯
Focusing
View GitHub Profile
@sullyo
sullyo / collect_code.sh
Created September 22, 2024 18:49
Clones a github repo and puts all the code into a single text file perfect for LLMs
#!/bin/bash
# Check if a GitHub URL is provided as an argument
if [ -z "$1" ]; then
echo "Usage: $0 <github_url>"
exit 1
fi
# Store the GitHub URL
GIT_URL="$1"
@mthenw
mthenw / README.md
Last active July 4, 2022 16:14
iTerm2 configuration
@megahertz
megahertz / MobxRnnProvider.js
Last active January 11, 2020 09:56
This is a provider which allows to use mobx-react Provider with wix/react-native-navigation.
import { Provider } from 'mobx-react/native';
const SPECIAL_REACT_KEYS = { children: true, key: true, ref: true };
export default class MobxRnnProvider extends Provider {
props: {
store: Object
};
context: {
@brentvatne
brentvatne / logs.markdown
Last active February 17, 2022 16:00
Logs for iOS / Android on your computer

Logs in iOS simulator

Option 1: Use GUI log

  1. In simulator, press ⌘ + / or go to Debug -> Open System Log.
  2. That's it.

Option 2: Open it in terminal

  1. Run instruments -s devices
@daltonclaybrook
daltonclaybrook / cocoapods-bundle-id
Last active January 21, 2022 22:36
A post install script for CocoaPods that changes the bundle identifier of all pods to the one specified.
post_install do |installer|
installer.project.targets.each do |target|
target.build_configurations.each do |config|
if config.name == 'BREnterprise'
config.build_settings['CODE_SIGN_IDENTITY[sdk=iphoneos*]'] = 'iPhone Distribution: The Carter Group LLC'
config.build_settings['PROVISIONING_PROFILE'] = '${BR_ENTERPRISE_PROVISIONING_PROFILE}'
end
end
end
@Critter
Critter / node.cmd
Created February 13, 2015 21:21
Install and link node with brew
Critter:lib critter$ brew install node
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/node-0.12.0.yosemite.bottle.1.tar.gz
######################################################################## 100.0%
==> Pouring node-0.12.0.yosemite.bottle.1.tar.gz
==> Caveats
If you update npm itself, do NOT use the npm update command.
The upstream-recommended way to update npm is:
npm install -g npm@latest
Bash completion has been installed to:
@angelix
angelix / angular-csrf-interceptor
Last active July 3, 2017 15:50
AngularJS CSRF Request Interceptor (for SailsJS)
app.factory('csrfRequestInterceptor' , function($q , $injector){
var _token = false;
return {
request : function(config){
var CSRF_URL = '/csrfToken';
if(config.url == CSRF_URL || config.method == "GET"){
return config;
}
// sailsjs hasn't time limit for csrf token, so it is safe to cache this
// remove this to request a new token
@katychuang
katychuang / remove_brew-mongo_osx.sh
Last active August 3, 2024 16:45
remove mongodb that was installed via brew
#!/usr/bin/env sh
# first check to see if mongo service is running. you can't delete any files until the service stops so perform a quick check.
launchctl list | grep mongo
# NOTE: the pipe | symbol means the commands on the right performs on the output from the left
# grep is a string search utility. `grep mongo` means search for the substring mongo
# use the unload command to end the mongo service. this is required to 'unlock' before removing the service.
# first look for the file to delete
MONGO_SERVICE_FILE=$(ls ~/Library/LaunchAgents/*mongodb*)
@afternoon
afternoon / rename_js_files.sh
Created February 15, 2014 18:04
Rename .js files to .ts
find app/src -name "*.js" -exec sh -c 'mv "$0" "${0%.js}.ts"' {} \;
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active November 18, 2024 11:51
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k