Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Lucas Michailian lmichailian

🏠
Working from home
View GitHub Profile
@lmichailian
lmichailian / mailgunlog.js
Last active Jun 2, 2020
(NODEJS) Script to log sent and accepted mails from mailgun
View mailgunlog.js
var exec = require('child_process').exec;
const util = require('util');
var args =
"-s --user 'APIKEY' -G \
https://api.mailgun.net/v3/DOMAIN/events \
--data-urlencode begin='DATE' \
--data-urlencode ascending=yes \
--data-urlencode limit=300 \
--data-urlencode pretty=yes \
View Validations
import { SET_PASSWORD_VALIDATION, CLEAR_PASSWORD_VALIDATION } from '../actions/ui/password'
const passwordReducer = (state = {}, actions) => {
switch (actions.type) {
case CLEAR_PASSWORD_VALIDATION:
return {}
case SET_PASSWORD_VALIDATION:
const {value, user} = actions.payload
const notEmpty = value !== '' && value !== undefined
@lmichailian
lmichailian / RockerCoin.sol
Created May 2, 2020
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.17+commit.d19bba13.js&optimize=false&gist=
View RockerCoin.sol
pragma solidity ^0.5.0;
contract RockerCoin {
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
mapping(address => uint256) public balanceOf;
mapping(address => mapping(address => uint256)) public allowance;
@lmichailian
lmichailian / logger.js
Created Feb 28, 2018 — forked from mariano-aguero/logger.js
Papertrail Winston
View logger.js
'use strict';
/* global __base */
let winston = require('winston'),
path = require('path'),
utils = require(__base + 'app/helpers/utils'),
util = require('util');
//winston logging for papertrail
require('winston-papertrail').Papertrail;
@lmichailian
lmichailian / DeviceForm.js
Created Feb 20, 2018 — forked from maotora/DeviceForm.js
Intergrating native-base styled components & redux-form.
View DeviceForm.js
import React, { Component } from 'react';
import { Grid, Col, Row } from 'react-native-easy-grid';
import * as renders from './renderedComponents';
import { Field, reduxForm } from 'redux-form';
import normalizePhone from './normalizePhone';
import { createRouter, withNavigation } from '@exponent/ex-navigation';
import {
Container,
Header,
Title,
View simple.php
<?php
class PostController
{
public function index()
{
return Post::all();
}
}
View complex.php
<?php
class PostController
{
public function __construct(PostRepository $postRepository)
{
$this->postRepository = $postRepository;
}
public function index()