Skip to content

Instantly share code, notes, and snippets.

Description

When using Homebrew (http://brew.sh) and searching formulas or pull requests you may get the dreaded error message: Github API Rate limit exceeded

Let's fix that! (yeah!)


Short version

Create a new Personal Token in your Github Account Settings (Sidebar: Applications) and then copy the Token. In the Terminal, use export HOMEBREW_GITHUB_API_TOKEN=YOURAPITOKENWITHFUNKYNUMBERSHERE (change that to your API Token) or add that to your .bash_profile and then do source .bash_profile.

@andromedarabbit
andromedarabbit / reset-the-last-commit-from-github.sh
Created July 22, 2015 01:54
Reset the last commit from GitHub
git push -f origin HEAD^:master
@andromedarabbit
andromedarabbit / squash-commits-with-git.sh
Last active August 29, 2015 14:25
Squash Commits with Git
# ref: http://davidwalsh.name/squash-commits-git
# switch to master branch
git checkout master
# ensure our master is up to date
git pull remoteRepoName master
# use git rebase to consolidate
git rebase -i master
@Inject
private PlatformTransactionManager transactionManager;
private void someMethod(boolean roolback) {
TransactionStatus transactionStatus = transactionManager.getTransaction(new DefaultTransactionDefinition());
// Do something
if (rollback) {
@andromedarabbit
andromedarabbit / install_gradle
Last active August 29, 2015 14:27 — forked from JMBattista/install_gradle
Upgrade Gradle Codeship
#!/bin/bash
# Allows using Gradle 2.6 with http://codeship.io
GRADLE=gradle-2.6-bin
GRADLE_URL="https://services.gradle.org/distributions/$GRADLE.zip"
wget -N $GRADLE_URL
mkdir -p ~/gradle
unzip $GRADLE.zip -d ~
@andromedarabbit
andromedarabbit / gradle-commands.md
Last active October 30, 2022 08:13
자주 쓰는 Gradle 명령어

자주 쓰는 Gradle 명령어

단위 테스트 돌리기

gradle test

단위 테스트는 건너뛰고 빌드하기

@andromedarabbit
andromedarabbit / build.gradle
Last active September 21, 2015 12:56 — forked from grafjo/build.gradle
Example gradle build to upload a Spring Boot based jar to nexus
group = "foo"
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.1.8.RELEASE")
}
}
@andromedarabbit
andromedarabbit / create-bootable-el-capitan-iso.sh
Last active June 20, 2023 21:41
Create bootable El Capitan ISO
#!/usr/bin/env bash -x
hdiutil attach "/Applications/Install OS X El Capitan.app/Contents/SharedSupport/InstallESD.dmg" -noverify -nobrowse -mountpoint /Volumes/install_app
exitStatus=$?
if [ $exitStatus -ne 0 ]; then
exit $exitStatus
fi
# Convert the boot image to a sparse bundle
hdiutil convert /Volumes/install_app/BaseSystem.dmg -format UDSP -o "/tmp/El Capitan"
@andromedarabbit
andromedarabbit / run-a-command-as-a-specific-user.sh
Created October 16, 2015 08:30
Run a command as a specific user
sudo -u <username> ....
@andromedarabbit
andromedarabbit / how-to-create-a-cpu-spike-with-a-bash-command.md
Last active January 30, 2023 15:39
How to create a CPU spike with a bash command

I use stress for this kind of thing, you can tell it how many cores to max out.. it allows for stressing memory and disk as well.

Example to stress 2 cores for 60 seconds

stress --cpu 2 --timeout 60

출처: How to create a CPU spike with a bash command

설치 방법