Skip to content

Instantly share code, notes, and snippets.

View thebergamo's full-sized avatar
🤟

Marcos Bérgamo thebergamo

🤟
View GitHub Profile
type IfStatNode struct {
Condition Node
ThenBranch Node
ElseBranch Node
}
func (n *IfStatNode) Interpret(i *Interpreter) (Node, error) {
conditionNode, err := n.Condition.Interpret(i)
if err != nil {
return nil, err
interface DHeap {
heap: number[];
breadth: number;
}
export function buildDHeap(breadth: number): DHeap {
return {
heap: [],
breadth,
};
function getToken (user) {
const secretKey = process.env.JWT || ‘stubJWT’;
return jwt.sign({ id: user._id, roles: user.roles }, secretKey, {expiresIn: ‘18h’});
}
console.log('lolololo');
.ngmp18 {
background-color: #fff;
overflow: hidden;
width: 100%;
height: 100%;
position: relative;
}
.ngmp18__hw3 {
color: #333;
@thebergamo
thebergamo / realworld.graphql
Last active November 10, 2017 16:56 — forked from steveluscher/realworld.graphql
The schema for thebergamo/realworld-graphql
### Articles
type Article {
author: Profile!
body: String!
comments(first: Int, after: String): CommentsConnection
createdAt: String!
description: String!
favorited: Boolean!
favoritesCount: Int!
slug: String!
@thebergamo
thebergamo / README.md
Created November 29, 2016 00:12
Shortcut for start/stop brew services

SS & SP for brew services

How to use

Copy the files above to /usr/local/bin and execute the command chown +x ss sp

For use it just:

starting a service ~> ss mongodb stoping a service ~> sp service

@thebergamo
thebergamo / ad.js
Created May 31, 2016 14:16 — forked from rbezerra/ad.js
ad.findUserAsync(login)
.then(function(user){
return ad.authenticateAsync(user.mail, password);
})
.then(function(auth){
if(!auth) res.status(403).send({"message": "user not authenticated"});
res.status(200).send({"message": "user authenticated","data": user});
})
.catch(function(err){
return next(err);
@thebergamo
thebergamo / controller.js
Last active April 7, 2016 20:11
Update valor total
//item-order --> esse json que é enviado no POST
{
"order": 1,
"product": 1,
"price": 10,
"quantity": 20
}
// [POST] /item-order
@thebergamo
thebergamo / README.md
Created April 2, 2016 17:06
Fullscreen Terminal on Mac

fs

Just make your terminal using fullscreen with a single command.

Get Started

To make this script works just follow the steps bellow.

  1. Create a file called fs
  2. Paste the content above (the other file in this gist) in the file fs
  3. Give powers to the script chown +x fs (in some cases sudo is required).
  4. Move the file to /usr/local/bin with the command cp fs /usr/local/bin