Skip to content

Instantly share code, notes, and snippets.

View fernandez14's full-sized avatar

Carlos Eduardo Fernández fernandez14

View GitHub Profile
@fernandez14
fernandez14 / datasheet.js
Created December 5, 2017 01:10
POO Datasheet example
import React from 'react'
import Select from 'react-select'
import _ from 'lodash'
import Datasheet from '../lib/DataSheet'
export default class ComponentSheet extends React.Component {
constructor (props) {
super(props)
this.options = [
{ label: 'Bread', value: 2.35 },
@fernandez14
fernandez14 / account.js
Last active May 12, 2017 16:07
Mithril 1.x component example.
import m from 'mithril';
import stream from 'mithril/stream';
import {Button} from '../../ui';
import {Account} from '../../models';
export const FormAccountPublicPage = {
oninit(vnode) {
this.loading = true;
this.saving = false;
this.errors = false;
@fernandez14
fernandez14 / intercom-gtm.js
Created April 2, 2017 17:34
intercom-gtm.js
<script>
// app ID
var intercomSettings = {
app_id: "{{intercom.id}}"
};
// Verifies and cleans all GTM variables
function pushGTMVariablesToIntercom(gtmKey, gtmValue) {
if("{{user.type}}" != "guest"){
@fernandez14
fernandez14 / prepare-datasets.sh
Last active January 2, 2022 00:32
Spider-srv API calls examples.
micro query sg.micro.srv.spider Spider.PrepareDatasets '{
"selector_id": 1,
"group": "motorcycle"
}'
@fernandez14
fernandez14 / selector-example.json
Created March 29, 2017 01:54
Spider-srv API calls examples.
{
"name": {"use": "text", "value": "h1 span", "filters": ["trim-space"]},
"screen": {"use": "text", "value": "#phone div[data-gallery] .col-xs-16 div.bor-t-1", "filters": ["trim-space"]},
"os": {"use": "text", "value": "#phone div[data-gallery] .col-xs-16 div.bor-t-1", "i": 1, "filters": ["trim-space"]},
"camera": {"use": "text", "value": "#phone div[data-gallery] .col-xs-16 div.bor-t-1", "i": 2, "filters": ["trim-space"]},
"storage": {"use": "text", "value": "#phone div[data-gallery] .col-xs-16 div.bor-t-1", "i": 3, "filters": ["trim-space"]},
}
/*
* Search and replace a string with another string , in a string
* */
char *str_replace(char *search , char *replace , char *subject)
{
char *p = NULL , *old = NULL , *new_subject = NULL ;
int c = 0 , search_size;
search_size = strlen(search);
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Authentication Driver
|--------------------------------------------------------------------------
|
| This option controls the authentication driver that will be utilized.
<?php
/**
* @Get("/{id:[0-9]+}")
* @AclAllow("scopes"={"basic"})
*/
public function getAction($id)
{
Filter::on($this, __FUNCTION__, func_get_args(), function($chain) {
[2015-05-15 18:31:35] local.ERROR: exception 'ReflectionException' with message 'Class cache does not exist' in /Users/fernandez104/Documents/AdmitOne/admitone/vendor/laravel/framework/src/Illuminate/Container/Container.php:776
Stack trace:
#0 /Users/fernandez104/Documents/AdmitOne/admitone/vendor/laravel/framework/src/Illuminate/Container/Container.php(776): ReflectionClass->__construct('cache')
#1 /Users/fernandez104/Documents/AdmitOne/admitone/vendor/laravel/framework/src/Illuminate/Container/Container.php(656): Illuminate\Container\Container->build('cache', Array)
#2 /Users/fernandez104/Documents/AdmitOne/admitone/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(644): Illuminate\Container\Container->make('cache', Array)
#3 /Users/fernandez104/Documents/AdmitOne/admitone/vendor/laravel/framework/src/Illuminate/Container/Container.php(1231): Illuminate\Foundation\Application->make('cache')
#4 /Users/fernandez104/Documents/AdmitOne/admitone/vendor/laravel/framework/src/Illuminate/Session/Se
@fernandez14
fernandez14 / gist:74838a73834ee7d30a78
Created December 11, 2014 00:02
Start neighborhoods indexing
forever start -c php app/cli.php index neighborhoods