Skip to content

Instantly share code, notes, and snippets.

View unicodeveloper's full-sized avatar
🔥
Developing Platforms

Prosper Otemuyiwa unicodeveloper

🔥
Developing Platforms
View GitHub Profile
@unicodeveloper
unicodeveloper / geocoder-service.js
Last active August 29, 2015 14:22 — forked from avaliani/geocoder-service.js
Fixed lodash error, Updated it to have lodash dependency
/*
* An AngularJS Service for intelligently geocoding addresses using Google's API. Makes use of
* localStorage (via the ngStorage package) to avoid unnecessary trips to the server. Queries
* Google's API synchronously to avoid `google.maps.GeocoderStatus.OVER_QUERY_LIMIT`.
*
* @author: benmj
* @author: amir.valiani
*
* Original source: https://gist.github.com/benmj/6380466
*/
@unicodeveloper
unicodeveloper / app.js
Last active September 25, 2015 19:21
Implementing Delete request to easily work with Laravel 5 - js file
$(document).ready(function() {
$("button.delete").on('click', function(e){
e.preventDefault();
if ( ! confirm('Are you sure?')) {
return false;
}
var action = $(this).data("action");
var parent = $(this).parent();
var token = $(this).data("token");
$.ajax({
Improper naming of functions
function names should start with a small letter
FetchGitData.php
Don’t commit private credentials. Load them from environment variables.
In function fetchData
<?php
namespace Busayo;
class MagicConstants
{
public function getFile()
{
return __FILE__;
@unicodeveloper
unicodeveloper / cab
Last active October 1, 2015 22:13
Cab file: Example code to show how to write CLI Scripts
#!/usr/bin/env php
<?php
/**
* Message displayed to the console if the user supplies no command
* @return void
*/
function helpMessage()
{
echo "
@unicodeveloper
unicodeveloper / *.md
Last active May 9, 2016 13:32 — forked from toddmotto/*.md
Component versus Directive in AngularJS

Component versus Directive in AngularJS

.component()

Components are not "helper" methods, they are the best change in Angular 1.x since I've been using it.

What is the role of .component()?

  • Declares new HTML via a template or templateUrl
  • Should be used to create Components as part of a Component architecture
<?php
// importing the necessary Cloudinary files
require 'Cloudinary.php';
require 'Uploader.php';
require 'Helpers.php';
require 'Api.php';
.....
@unicodeveloper
unicodeveloper / modules.txt
Created September 12, 2016 15:53
Brief description of node modules
async - For managing asynchronous flow
bcrypt - For hashing passwords
body-parser - For parsing POST request data
cloudinary - For uploading videos to Cloudinary Storage
cors - For managing cross origin request permissions
dotenv - For reading environment values from the .env file
express - Web framework for Node.js
gravatar - For fetching a user's avatar from the popular gravatar service
jwt-simple - For creating json web tokens
lodash - For easy manipulation of data structure
@unicodeveloper
unicodeveloper / server.js
Created September 12, 2016 15:55
Minimal Express application - Cloudinary Blog Post, Part 1
require('dotenv').load();
var express = require('express'),
morgan = require('morgan'),
bodyParser = require('body-parser'),
mongoose = require('mongoose'),
cors = require('cors'),
testdb = require('./config/testdb'),
route = require('./server/routes');
var port = process.env.PORT || 3000;
module.exports = {
db: process.env.MONGODB || process.env.MONGOHQ_URL,
TOKEN_SECRET: process.env.TOKEN_SECRET,
};