Skip to content

Instantly share code, notes, and snippets.

Avatar

Thiago Delgado thiagodelgado111

View GitHub Profile
@thiagodelgado111
thiagodelgado111 / intro.md
Created Apr 5, 2020 — forked from derhuerst/intro.md
Installing Git on Linux, Mac OS X and Windows
View intro.md
View StoreBuilder.js
class StoreBuilder {
constructor(StoreClass, ipfs, peerId, address) {
if (!StoreClass) throw new Error('Store class to build not defined')
if (!ipfs) throw new Error('IPFS is required')
if (!peerId) throw new Error('peerId is required')
if (!address) throw new Error('Store address is required')
this.StoreClass = StoreClass
this.ipfs = ipfs
View simpleModifierExample.sol
pragma solidity ^0.4.15;
contract Example {
address public owner;
function Example () {
owner = msg.sender;
}
@thiagodelgado111
thiagodelgado111 / complexity_test.js
Last active Nov 25, 2016
eslint complexity rule question
View complexity_test.js
const a = true;
const b = false;
const c = true;
if (a && b && c) {
throw new Error('zomg!');
}
if (a || b || c) {
@thiagodelgado111
thiagodelgado111 / mantras
Last active Feb 20, 2016 — forked from IngmarBoddington/mantras
Coding Mantras
View mantras
* Don't Repeat Yourself - DRY
- Don't repeat code
- Use reusability
* Keep It Simple Stupid - KISS
- Don't overcomplicate for it's own sake
* Don't make me think.
* Program to an interface.
* Composisition over inheritance.
View custom_server_start.js
var client = new CustomServer(CONFIG_PARAMETERS);
client.createConnection();
client.open();
client.on('serverCreated', function(socket) {
if (!!client.socket) {
if (FIXTURES.Nodes.length > 0) {
View CustomServer.js
/*jslint node: true */
var net = require('net');
var EventEmitter = require('events').EventEmitter;
var util = require('util');
var _ = require('lodash');
var S = require('string');
var traceback = require('traceback');
var dateFormat = require('date-format');
var os = require("os");
View fogcrack
var dcrypt = function(a){
var letters = "acdegilmnoprstuw";
var str = "";
var dcrypted = false;
while(!dcrypted){
for(var i = 0; i < letters.length; i++)
{
View bencode.js
var bencode = new Bencode();
bencode.Encoding.Encode(1); //"i1e"
bencode.Encoding.Encode([1,2,3, {"Test" : 123} ]); //"li1ei2ei3ed4:Testi123eee"
bencode.Encoding.Encode("Test"); //"4:Test"
bencode.Encoding.Encode(-1), //"i-1e"
bencode.Encoding.Encode(0); //"i0e"
bencode.Encoding.Encode(01); //"i1e" `
bencode.Decoding.Decode("i10e"); //10
@thiagodelgado111
thiagodelgado111 / flask
Last active Aug 17, 2017
flask hello world
View flask
#!/bin/python
from flask import Flask, render_template, jsonify, send_from_directory, request
app = Flask("MY_GR8_APP", static_folder='static', static_url_path='')
app.debug = True
@app.route("/hello/")
def richie():
return "It's me you're looking for..."