Skip to content

Instantly share code, notes, and snippets.

Avatar
🚀
Launching...

Daniel Primo delineas

🚀
Launching...
View GitHub Profile
@delineas
delineas / sample.sol
Created Dec 10, 2018
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.1+commit.c8a2cb62.js&optimize=false&gist=
View sample.sol
pragma solidity >=0.4.22 <0.6.0;
contract SampleContract {
uint storageData;
function set(uint x) public {
storageData = x;
}
function get() public view returns (uint) {
return storageData;
}
@delineas
delineas / app.py
Created Nov 12, 2018
#desafíoPython Scraping data oneliners
View app.py
for programs in resource.findAll("div", {"class": ["modulo-type-programa"]}):
podcasts.append(
{
'title': ["%s" % name.attrs['content'] for name in programs.select('meta[itemprop="name"]')][0],
'description': ["%s" % desc.attrs['content'] for desc in programs.select('meta[itemprop="description"]')][0],
'url': ["%s" % url.attrs['content'] for url in programs.select('meta[itemprop="url"]')][0],
'episodes': ["%s" % micro.getText().strip() for micro in programs.select('.microphone')][0]
}
)
View 2018_11_05_170704_add_hash_id_fields_users_table.php
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddHashIdFieldsUsersTable extends Migration
{
/**
* Run the migrations.
@delineas
delineas / app.js
Created Oct 31, 2018
Vee-Validate Vue User
View app.js
import VeeValidate from "vee-validate";
import Axios from "axios";
Vue.use(VeeValidate);
VeeValidate.Validator.extend("unique", {
getMessage: field => "Ya existe un usuario con este e-mail",
validate: value => {
console.log(value);
if (value) {
View react.html
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js">
<!--<![endif]-->
<head>
<meta charset="utf-8">
View branch-organization.md

Scenario

Work is done within a feature branch created from master. You've incrementally gotten the feature branch working as expected; however, you'd prefer to re-organize your commits so that you can better reason about the changes.

Setup

Let's create a new repository in order to set the stage:

 % mkdir repo
 % cd repo
 % git init
@delineas
delineas / drupal8-links.php
Created Jul 24, 2018 — forked from colorfield/drupal8-links.php
Drupal 8 links, or where is my l() function
View drupal8-links.php
@delineas
delineas / TermBreadcrumbBuilder.php
Created Jul 16, 2018 — forked from eeeschwartz/TermBreadcrumbBuilder.php
Load breadcrumbs from a Drupal 8 node's taxonomy term
View TermBreadcrumbBuilder.php
<?php
/**
* @file
* Contains \Drupal\taxonomy\TermBreadcrumbBuilder.
*/
namespace Drupal\taxonomy;
use Drupal\Core\Breadcrumb\BreadcrumbBuilderInterface;
View Drupal 8 loop entity reference fields.twig
Twig coding standards
https://www.drupal.org/node/1823416
Filters - Modifying Variables In Twig Templates
https://www.drupal.org/node/2357633
{% for i, value in content.field_app_prod_toggle_products %}
{% if node.field_app_prod_toggle_products[i].entity %}
{% if i == 0 %}
You can’t perform that action at this time.