Skip to content

Instantly share code, notes, and snippets.

View alesanabriav's full-sized avatar
🗺️

Alejandro Sanabria alesanabriav

🗺️
View GitHub Profile
WEBVTT
1
00:00:00,540 --> 00:00:04,760
Vas a escribir tu primera línea de código
y aprender a programar.
2
00:00:04,900 --> 00:00:07,740
Lo primero que necesito que hagas
function cl_create_person($appId, $apiKey, $data, $endpoint = 'https://api.convertloop.co/v1/people') {
try {
if(empty($data['pid'])) {
$data['pid'] = isset($_COOKIE['dp_pid']) ? $_COOKIE['dp_pid'] : '';
}
// $data: { "email": "alejandro@acn.com", "pid": "", "add_tags": ["ENGLISH"] }
$data = json_encode($data);
$auth_string = $appId . ":" . $apiKey;
$auth = base64_encode($auth_string);
editText.addTextChangedListener(object: TextWatcher {
override fun afterTextChanged(s: Editable?) {
textAge.text = s.toString()
}
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
}
const postsQuery = {
type: new GraphQLList(Post),
args: {
//to paginate
limit: { type: GraphQLInt },
offset: { type: GraphQLInt }
},
resolve(root, args, ctx) {
return Post.findAll(args);
}
@alesanabriav
alesanabriav / post_type.js
Last active June 8, 2017 17:10
Graphql post type
let postType = new GraphQLObjectType({
name: "todo",
fields: () => ({
title: { type: GraphQLString },
author: { type: GraphQLString },
body: { type: GraphQLString }
});
@alesanabriav
alesanabriav / post_model.js
Last active June 8, 2017 17:13
sequelize model example
let Post = sequelize.define(
"Post",
{
title: { type: Sequelize.STRING },
author: { type: Sequelize.STRING },
body: { type: Sequelize.TEXT }
}
);
@alesanabriav
alesanabriav / post_model.js
Last active June 8, 2017 17:07
mongoose model example
let postSchema = new mongoose.Schema({
title: { type: String },
author: { type: String },
body: { type: String }
)};
mongoose.model('Post', postSchema);
const Component = React.createClass({
getInitialState() {
return {
name: 'ale',
posts: []
}
},
componentWillUpdate() {
console.log(this.state);
@alesanabriav
alesanabriav / infusion_wp_api.php
Last active March 14, 2017 20:52
Infusion api helper for wordpress
<?php
// Include WordPress libraries to handle XML-RPC
require_once ABSPATH . '/wp-includes/class-IXR.php';
require_once ABSPATH . '/wp-includes/class-wp-http-ixr-client.php';
class Infusionsoft {
public $api_key;
public $error = FALSE;
public $subdomain;