Skip to content

Instantly share code, notes, and snippets.

To manipulate Bitbucket repository with token:
First you create an "Oauth" in access management section of your bitbucket account setting. This gives you a "Key" and a "Secret". You have done this bit.
Now using these Key and Secret you ask Bitbucket for a token. In my case I made a http request to https://bitbucket.org/site/oauth2/access_token. I could do it with Curl or some Ajax library like this:
curl -X POST -u "yourKeyHere:yourSecretHere" https://bitbucket.org/site/oauth2/access_token -d grant_type=client_credentials
alternatively, my http request was like this (using superagent in node) with my Content-Type set to application/x-www-form-urlencoded you can use postman:
request.post("https://yourKeyHere:[email protected]/site/oauth2/ access_token").send('grant_type=client_credentials');`
the result is like this:
  • Dynamic Dispatch
  • Dynamic Method
  • Ghost Methods
  • Dynamic Proxies
  • Blank Slate
  • Kernel Method
  • Flattening the Scope (aka Nested Lexical Scopes)
  • Context Probe
  • Class Eval (not really a 'spell' more just a demonstration of its usage)
  • Class Macros
@israelb
israelb / DS.md
Last active November 1, 2017 02:30
Golang

reference: The Go Programming Language

Composite Types:

ARRAYS

// array of 3 integers
// the array literal is: [3]
var a [3]int  
# app/models/request_manager.rb
class RequestManager < ApplicationRecord
# associations
belongs_to :requestable, polymorphic: true
# constants
DELIVERS = %w(now later system).freeze
@israelb
israelb / installing_cassandra.md
Created January 30, 2018 02:51 — forked from hkhamm/installing_cassandra.md
Installing Cassandra on Mac OS X

Installing Cassandra on Mac OS X

Install Homebrew

Homebrew is a great little package manager for OS X. If you haven't already, installing it is pretty easy:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
@israelb
israelb / install-comodo-ssl-cert-for-nginx.rst
Created February 13, 2018 03:31 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@israelb
israelb / main.go
Created February 16, 2018 19:22 — forked from Tamal/main.go
Connect local dynamodb using Golang
package main
import (
"log"
"net/http"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/dynamodb"
)
@israelb
israelb / createtable.js
Created February 20, 2018 23:49
dynamo localmente
// create table
var params = {
TableName: 'Report',
KeySchema: [
{
AttributeName: 'UserID',
KeyType: 'HASH',
},
],
AttributeDefinitions: [
################################################################################
############################# Monit control file #############################
################################################################################
##
#
# Comments begin with a '#' and extend through the end of the line. Keywords
# are case insensitive. All path's MUST BE FULLY QUALIFIED, starting with '/'.
#
# 1. Clear retry set
Sidekiq::RetrySet.new.clear
# 2. Clear scheduled jobs
Sidekiq::ScheduledSet.new.clear
# 3. Clear 'Processed' and 'Failed' jobs