Skip to content

Instantly share code, notes, and snippets.

@tebajanga
tebajanga / Content.js
Created November 29, 2018 05:35
Removing Specific Element in Array React
import React, { Component } from 'react';
import * as _ from 'lodash';
class Content extends Component {
state = {
products: [ {id: 1, name: 'some name'},
{ id: 2, name: 'some other name'},
{ id: 3, name: 'some other name 2'},
{ id: 4, name: 'other stuff'},
@tebajanga
tebajanga / request_no_curl.php
Created August 27, 2018 12:53 — forked from iNaD/request_no_curl.php
Sending a GET/POST Request via PHP without CURL (fopen needs to be enabled)
<?php
$url = 'http://server.com/path';
$data = array('key1' => 'value1', 'key2' => 'value2');
// use key 'http' even if you send the request to https://...
$options = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'method' => 'POST',
'content' => http_build_query($data),
@tebajanga
tebajanga / GitHub-Forking.md
Created May 22, 2018 22:56 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@tebajanga
tebajanga / detached-head-merge.ps1
Created March 30, 2018 08:09 — forked from cmatskas/detached-head-merge.ps1
Git merge detached head
$git checkout –b temp #makes a new branch from current detached HEAD
$git branch –f master temp #update master to point to the new <temp> branch
$git branch –d temp #delete the <temp> branch
$git push origin master #push the re-established history