Skip to content

Instantly share code, notes, and snippets.

View designviacode's full-sized avatar
🎯
Focusing

Manpreet Singh designviacode

🎯
Focusing
View GitHub Profile
@designviacode
designviacode / Setup.md
Last active August 29, 2015 14:27 — forked from suvozy/Setup.md
Setup AWS EC2 and RDS (php5.5, apache2.4, mysql5.5, phpmyadmin)
@designviacode
designviacode / BlogController.php
Created March 21, 2016 23:23 — forked from tobysteward/BlogController.php
Laravel AJAX Pagination with JQuery
<?php
class BlogController extends Controller
{
/**
* Posts
*
* @return void
*/
public function showPosts()
@designviacode
designviacode / README.md
Created August 29, 2016 20:45 — forked from hofmannsven/README.md
My simply Git Cheatsheet
@designviacode
designviacode / index.js
Created January 26, 2017 23:45 — forked from mrzmyr/index.js
React Native - Detect Double Tap
var Index = React.createClass({
getInitialState: function () {
return {
lastPress: 0
}
},
onPress: function () {
var delta = new Date().getTime() - this.state.lastPress;
import React, { Component, PropTypes } from "react";
class SocketProvider extends Component {
constructor(props, context) {
super(props, context);
this.socket = context.socket;
}
render() {
return (
export default class Api {
static headers() {
return {
Accept: "application/json",
"Content-Type": "application/json"
};
}
static get(route) {
return this.request(route, null, "GET");
@designviacode
designviacode / setup.md
Created November 4, 2017 00:48 — forked from shashankmehta/setup.md
Setup PHP and Composer on OSX via Brew

First install Brew on your MAC

  • Setup Brew: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • brew update
  • brew tap homebrew/dupes
  • brew tap homebrew/php
  • Install PHP 7.0.+ brew install php70
  • Install mcrypt: brew install mcrypt php70-mcrypt
  • Finally, install composer: brew install composer
@designviacode
designviacode / MySQL_macOS_Sierra.md
Created November 4, 2017 00:48 — forked from nrollr/MySQL_macOS_Sierra.md
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :

@designviacode
designviacode / README.md
Created November 5, 2017 22:48
Sequelize + Express + Migrations + Seed Starter
// Destructuring cleans it up a bit
const { postCatalogues, updateCatalogues } = this.props;
const { catalogueName, activeStatusValidation } = formValidation;
// Bail early
if (catalogueName || activeStatusValidation) return;
// Model the data to avoid a switch - this makes more sense to me - seems more clear - you could even take this out of
// this method completely and include it as a property on the React component, as you may end up with more than add and edit,
// and perhaps it will be needed elsewhere?