Skip to content

Instantly share code, notes, and snippets.

View omitobi's full-sized avatar
👑
The faithful shall receive the crown of life from Jesus

Oluwatobi Samuel Omisakin omitobi

👑
The faithful shall receive the crown of life from Jesus
View GitHub Profile
@omitobi
omitobi / setSomeProperties.js
Created August 13, 2018 10:20
Set some properties of an object using destructing of ES2015
const this_ = {};
this_.questions: {
id: null,
text: '',
description: null,
enabled: 1,
recipients: []
};
@omitobi
omitobi / 01.md
Created July 20, 2018 10:51 — forked from nasrulhazim/01.md
Laravel Default API Login

Setup

Migration

Create new migration script:

php artisan make:migration add_api_token --table=users
@omitobi
omitobi / gist:451bccad818ed5998690db1a7e5b513e
Created July 13, 2018 13:35 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@omitobi
omitobi / python_environment_setup.md
Created July 10, 2018 11:38 — forked from Geoyi/python_environment_setup.md
Setting up your python development environment (with pyenv, virtualenv, and virtualenvwrapper)

Overview

When you're working on multiple coding projects, you might want a couple different version of Python and/or modules installed. That way you can keep each project in its own sandbox instead of trying to juggle multiple projects (each with different dependencies) on your system's version of Python. This intermediate guide covers one way to handle multiple Python versions and Python environments on your own (i.e., without a package manager like conda). See the Using the workflow section to view the end result.

Use cases

  1. Working on 2+ projects that each have their own dependencies; e.g., a Python 2.7 project and a Python 3.6 project, or developing a module that needs to work across multiple versions of Python. It's not reasonable to uninstall/reinstall modules every time you want to switch environments.
  2. If you want to execute code on the cloud, you can set up a Python environment that mirrors the relevant
@omitobi
omitobi / reduxinbit.js
Created January 26, 2018 11:04
redux in bit
const reducer = ( state = [], action) => {
if (action.type === 'split_string') {
return action.payload.split('');
}
if (action.type === 'add_character') {
return [...state, action.payload];
}
return state;
};
@omitobi
omitobi / str_pad.php
Created November 7, 2017 12:56
String pad
/**
* @param string $string
* @param string $pad
* @param int $expected_length
* @return string
*/
function str_pad($string, $pad, $expected_length)
{
$left = $expected_length - strlen($string);
while ($left > 0) {
@omitobi
omitobi / assertArrayStructure.php
Created November 3, 2017 08:09
assertArrayStructure function for testing PHP_Unit in Laravel
<?php
namespace Tests\Unit;
use Tests\TestCase;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
class ExampleTest extends TestCase
{
@omitobi
omitobi / ideas.md
Last active October 6, 2020 19:27
Ideas to implement
  • Carbonate - Carbon+Collections (PHP)
  • Watson conversation's sdk for php (or Laravel)
    • setting context, (on the fly)
  • Purely Original thoughts of people's post on social media (starting with friends on Facebook)
  • Notes app - add quick personal notes to copy
  • Synchronous communication on JS (example with chat)
@omitobi
omitobi / matrix_transpose.php
Last active September 25, 2017 04:37
Transpose matrix without regex
<?php
$string = "z a b c\nd e f k\np q r s";
$string2 = explode("\n",$string);
$string3 = array_map(function($item){
return explode(' ',$item);
}, $string2);
$value = array_map(NULL, ...$string3);
$result = array_map(function ($val) {
<?php
namespace App\Http;
/**
* Description of VideoStream
*
* @author Rana
* @link https://gist.github.com/vluzrmos/d5682ad426525196d069
*/