Skip to content

Instantly share code, notes, and snippets.

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

t tashirka1

🏠
Working from home
View GitHub Profile
@tashirka1
tashirka1 / paginated_collection.js
Created January 16, 2016 17:28 — forked from takinbo/paginated_collection.js
Pagination with Backbone.js & django-tastypie
// includes bindings for fetching/fetched
var PaginatedCollection = Backbone.Collection.extend({
initialize: function() {
_.bindAll(this, 'parse', 'url', 'pageInfo', 'nextPage', 'previousPage', 'filtrate', 'sort_by');
typeof(options) != 'undefined' || (options = {});
typeof(this.limit) != 'undefined' || (this.limit = 20);
typeof(this.offset) != 'undefined' || (this.offset = 0);
typeof(this.filter_options) != 'undefined' || (this.filter_options = {});
typeof(this.sort_field) != 'undefined' || (this.sort_field = '');
@tashirka1
tashirka1 / readme.md
Created April 19, 2017 18:25 — forked from nasrulhazim/readme.md
Send Welcome Email Notification with Event and Listener

Send Welcome Email Notification with Event and Listener

Step 1

Create SendWelcomeEmailNotification notification

php artisan make:notification SendWelcomeEmailNotification
@tashirka1
tashirka1 / readme.md
Created April 19, 2017 18:25 — forked from nasrulhazim/readme.md
Enable Account Activation in Order to Login to the System.
@tashirka1
tashirka1 / readme.md
Created April 19, 2017 18:25 — forked from nasrulhazim/readme.md
Using Middleware to Check Account Activation and Resend Activation E-mail
@tashirka1
tashirka1 / dry_n_skinny.md
Created April 19, 2017 18:34 — forked from nasrulhazim/dry_n_skinny.md
Dry & Skinny Laravel Application

Dry & Skinny

  1. Fat Model & Skinny Controller

  2. Bus / Job Pattern

    • Command Bus > Jobs
      • A task take a small unit of work
      • NOT return a value
    • Further reading: CRUD & CQRS
    • Reusable, Skinny Controller as more reusable codes move to Job
@tashirka1
tashirka1 / apidev-01.md
Created April 19, 2017 18:37 — forked from nasrulhazim/apidev-01.md
API Basic

API Development with Vanilla PHP

In this tutorial, just want to expose the basic of API Development with plain PHP.

You should install https://www.getpostman.com/ before proceed with this tutorial.

Objectives

  1. Understand what is the headers
  2. Understand the Content-Type
@tashirka1
tashirka1 / letsencrypt.md
Created April 21, 2017 02:46 — forked from xrstf/letsencrypt.md
Let's Encrypt on Ubuntu 14.04, nginx with webroot auth

Let's Encrypt on Ubuntu 14.04, nginx with webroot auth

This document details how I setup LE on my server. Firstly, install the client as described on http://letsencrypt.readthedocs.org/en/latest/using.html and make sure you can execute it. I put it in /root/letsencrypt.

As it is not possible to change the ports used for the standalone authenticator and I already have a nginx running on port 80/443, I opted to use the webroot method for each of my domains (note that LE does not issue wildcard certificates by design, so you probably want to get a cert for www.example.com and example.com).

Configuration

For this, I placed config files into etc/letsencrypt/configs, named after <domain>.conf. The files are simple:

{
"debug": {
"status": 200
},
"result": [
{
"id": "adagio_moscow_paveletskaya",
"city": "Moscow",
"check_in_time": "14:00",
"rating": {
@tashirka1
tashirka1 / gist:8319103c2b9c4fcce40b263368ad61a2
Created June 14, 2017 10:18 — forked from craigminihan/gist:b23c06afd9073ec32e0c
Build GCC 4.9.2 for C/C++ on CentOS 7
sudo yum install libmpc-devel mpfr-devel gmp-devel
cd ~/Downloads
curl ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-4.9.2/gcc-4.9.2.tar.bz2 -O
tar xvfj gcc-4.9.2.tar.bz2
cd gcc-4.9.2
./configure --disable-multilib --enable-languages=c,c++
make -j 4
make install
@tashirka1
tashirka1 / jssip.md
Created June 19, 2017 08:40 — forked from dtolb/jssip.md
JsSip Demo

#JSSIP with Catapult API ​ ##Prerequisites ​

  • Register for a Catapult (Bandwidth Application Platform) account here
  • Register a SIP domain
  • Create an endpoint/user
  • If you want to make calls to the PSTN (normal phones) you will need a server to handler events from Catapult
  • Make phone calls ​