Small script for checking and consuming Codex rate-limit reset credits from the CLI.
This is mainly useful if you use Codex from the terminal, especially on Linux, where the Codex desktop app/reset UI may not be available or convenient.
You need:
| { | |
| "GenServer Template": { | |
| "scope": "elixir", | |
| "prefix": "gs", | |
| "body": [ | |
| "defmodule ${1}.${2} do", | |
| "\tuse GenServer", | |
| "", | |
| "\t# Client", | |
| "", |
| require 'rubygems' | |
| require 'google/api_client' | |
| client = Google::APIClient.new( | |
| application_name: 'Ruby Google Calendar Example', | |
| application_version: '1.0.0') | |
| calendar = client.discovered_api('calendar', 'v3') | |
| key = Google::APIClient::PKCS12.load_key('./keys/creds.p12', 'notasecret') | |
| asserter = Google::APIClient::JWTAsserter.new( |
| require 'rubygems' | |
| require 'bundler/setup' | |
| Bundler.require | |
| refresh_token = 'REDACTED' | |
| CLIENT_ID = 'REDACTED' | |
| CLIENT_SECRET = 'REDACTED' | |
| client = OAuth2::Client.new(CLIENT_ID, CLIENT_SECRET, { | |
| :authorize_url => 'https://accounts.google.com/o/oauth2/auth', |
| apt-get install build-essential libssl-dev libcurl4-openssl-dev libreadline-gplv2-dev zlib1g-dev libxslt1-dev libxml2-dev | |
| cd /usr/src | |
| wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p385.tar.gz | |
| tar zxvf ruby-1.9.3-p385.tar.gz | |
| cd ruby-1.9.3-p385 | |
| ./configure | |
| make && make install | |
| cd ext/openssl |
| --- | |
| en-GB: | |
| number: | |
| currency: | |
| format: | |
| format: "%u%n" | |
| unit: "£" | |
| precision: 2 | |
| separator: '.' | |
| delimiter: ',' |
| #!/bin/sh | |
| mkdir ~/local | |
| echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.zshrc | |
| . ~/.zshrc | |
| git clone git://github.com/joyent/node.git | |
| cd node | |
| ./configure --prefix=~/local | |
| make install |
| if [ -d ~/.oh-my-zsh ] | |
| then | |
| echo "\033[0;33mYou already have Oh My Zsh installed.\033[0m You'll need to remove ~/.oh-my-zsh if you want to install" | |
| exit | |
| fi | |
| echo "\033[0;34mCloning Oh My Zsh...\033[0m" | |
| /usr/bin/git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh | |
| echo "\033[0;34mLooking for an existing zsh config...\033[0m" |
| #!/bin/bash | |
| echo -e "\e[1;36mUPDATING PACKAGES\e[00m" | |
| echo "deb http://nginx.org/packages/debian/ squeeze nginx" | tee -a /etc/apt/sources.list | |
| echo "deb-src http://nginx.org/packages/debian/ squeeze nginx" | tee -a /etc/apt/sources.list | |
| apt-get --quiet --assume-yes update | |
| echo -e "\e[1;36mINSTALLING PACKAGES\e[00m" | |
| apt-get --assume-yes --allow-unauthenticated --quiet install build-essential bzip2 openssl libssl-dev libreadline6 libreadline6-dev libxml2-dev libxslt-dev libsqlite3-dev sqlite3 subversion vim zsh zlib1g zlib1g-dev nginx sudo git python libcurl4-openssl-dev libpcre3-dev mercurial libyaml-dev imagemagick | |
| useradd -m -c "spree" -s /bin/bash spree | |
| adduser spree sudo | |
| curl http://betterthangrep.com/ack-standalone > /usr/bin/ack && chmod 0755 /usr/bin/ack |
| # Add this to your boot.rb before Padrino.load! | |
| # and add: gem 'pry' | |
| # to your Gemfile and run bundle to install. | |
| begin | |
| require 'pry' | |
| $VERBOSE = nil | |
| IRB = Pry | |
| $VERBOSE = false | |
| rescue LoadError |