Skip to content

Instantly share code, notes, and snippets.

View wmucheru's full-sized avatar
💭
AI?

wmucheru

💭
AI?
View GitHub Profile
@wmucheru
wmucheru / geojson-filter.js
Last active January 23, 2018 10:13
Pick the property values from an existing GeoJSON, output as json string
let features = sourceJSON.features,
newFeatures = [];
features.map((feature, index) => {
let properties = feature.properties,
ft = {
geometry: feature.geometry,
properties: {
continent: properties.continent,
@wmucheru
wmucheru / soap-post.php
Created January 7, 2018 16:04
Make a Soap Request using PHP
function makeSOAPRequest($url, $soap_body){
$ch = curl_init();
curl_setopt( $ch, CURLOPT_URL, $url);
curl_setopt( $ch, CURLOPT_POST, true);
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt( $ch, CURLOPT_POSTFIELDS, $soap_body);
$result = curl_exec($ch);
@wmucheru
wmucheru / TagsInput.jsx
Last active May 9, 2019 12:36
React Tags Input component. Used in multiple emails/tags entry
import React, { Component } from 'react';
export default class TagsInput extends Component{
constructor(props){
super(props);
this.state = {
tags: []
};