Skip to content

Instantly share code, notes, and snippets.

🐍
Snake! Snake! Oooh it is a snake!

Morabaraba Morabaraba

🐍
Snake! Snake! Oooh it is a snake!
  • Digital Nomad
Block or report user

Report or block Morabaraba

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Morabaraba
Morabaraba / hello.py
Created Sep 25, 2018
modified `hello.py` [connexion](https://github.com/zalando/connexion/) example to include `Accept` header validation decorator.
View hello.py
#!/usr/bin/env python3
import connexion
import flask
from decorator import decorator
@decorator
def requires_header(f: callable, *args, **kwargs):
accept = flask.request.headers.get('Accept')
print(accept)
if not accept or accept != 'application/xml':
@Morabaraba
Morabaraba / c9.v2.ace.build.issue.md
Created May 10, 2017
GET http://localhost:3131/static/ace/build/ace.js 404 (Not Found) Cloud9 v2
View c9.v2.ace.build.issue.md

Did a npm install and npm update and got the following WARN.

npm WARN cannot run in wd cloud9@2.1.5 cd node_modules/ace; make clean pre_build; ./Makefile.dryice.js minimal; cd ../.. (wd=/opt/cloud9)

When I started the server cloud9 reported:

GET http://localhost:3131/static/ace/build/ace.js  404 (Not Found) Cloud9 v2
View cloud9.issues.21.md

For https://github.com/exsilium/cloud9/issues/21

Tested on Win 10, thanks. Will test on a mac soon.

First tried a npm update on the project to get your ctrl+v change. Realised I need to git clone https://github.com/exsilium/term.js.git instead.

It to crude?

ubuntu@ubuntu-xenial:~/bin/cloud9/node_modules/term.js$ npm update
View git-tricks.md

change name and surname in all previous commits?

git filter-branch --commit-filter 'if [ "$GIT_AUTHOR_NAME" = "Your Name" ];
  then export GIT_AUTHOR_NAME="Morabaraba May"; export GIT_AUTHOR_EMAIL=TOPS3CR3T;
  fi; git commit-tree "$@"'

http://stackoverflow.com/a/4494037

@Morabaraba
Morabaraba / qici-projects.md
Last active Mar 10, 2017
List of QICI Projects with source
View qici-projects.md

Firstly I want to thank the QICI team for their extensive list of demos. If you want to know how to do something you will most probably find a example there.

This list is more of projects I found scattered on github, self promotion, etc. If you want something added please let me know!

note atm most projects is just prototypes, toys or just someone checking the env and sharing their knowledge.

View simple-qici-log-server.js
// hacked from the code at https://github.com/qiciengine/qiciengine-server
var port = 8900;
var bodyParser = require('body-parser')
var express = require('express');
var app = express();
var http = require('http').Server(app);
// 监听端口重复事件以进行重试
http.on('error', function(e) {
console.error('端口监听失败:%s', e.code);
@Morabaraba
Morabaraba / ClockingIT-Ubuntu-10.04.md
Created Jan 9, 2017
How to install ClockingIT on Ubuntu 10.04
View ClockingIT-Ubuntu-10.04.md
@Morabaraba
Morabaraba / README.md
Created Nov 30, 2016
Oracle PDO OCI PHP Driver on CentOS 6
View README.md

Oracle PDO OCI PHP Driver on CentOS 6

rpm -ivh oracle-instantclient11.2-basic-11.2.0.3.0-1.x86_64.rpm
rpm -ivh oracle-instantclient11.2-devel-11.2.0.3.0-1.x86_64.rpm
cp pdo_oci.so /usr/lib64/php/modules/pdo_oci.so
cp oracle.conf /etc/ld.so.conf.d/oracle.conf
/etc/init.d/httpd reload
@Morabaraba
Morabaraba / erlang+epgsql.md
Created Aug 27, 2016
Basic erlang.mk and epgsql
View erlang+epgsql.md

PostgreSQL + Erlang

erlang.mk

Create a Makefile, see the erlang.mk getting started guide.

PROJECT = example1
DEPS = epgsql
include erlang.mk
@Morabaraba
Morabaraba / q-bert-decode-js-py.md
Last active Aug 7, 2016
Python bert.decode not working between Javascript and Python.
View q-bert-decode-js-py.md

So I'm using Bert in js with MQTT pushing it over ws to rabbitmq where a pika consumer reads the body and tries to decode the js BERT encoded body; and it fails.

    def on_message(self, unused_channel, basic_deliver, properties, body):
        print("raw body:")
        print(body)
        print("oct body:")
        for c in body: print(c)
        berty = bert.decode(body)
You can’t perform that action at this time.