Skip to content

Instantly share code, notes, and snippets.

View iZaL's full-sized avatar

Afzal Abbas iZaL

View GitHub Profile
@iZaL
iZaL / install_ffmpeg_ubuntu.sh
Created March 27, 2016 10:38 — forked from xdamman/install_ffmpeg_ubuntu.sh
Install latest ffmpeg on ubuntu 12.04 or 14.04
#!/bin/bash
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04
# Inspired from https://gist.github.com/faleev/3435377
# Remove any existing packages:
sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev
# Get the dependencies (Ubuntu Server or headless users):
sudo apt-get update
@iZaL
iZaL / 1-react-native-simulator-and-device.md
Created April 2, 2016 14:27 — forked from almost/1-react-native-simulator-and-device.md
Test React Native on the simulator and on a device without editing the code each time!

In the default React Native app scaffolding you have to edit AppDelegate.m to change where it loads the code if you want to test on your device. I use the following snippet to detect if it's being compiled for Debug or Production and for the Simulator or a device. For Production it uses a copy of the code included in the bundle, for Debug on the simualtor it loads from a server on localhost and for Debug on a device it loads from a server on a given IP address.

NOTE: You need to edit YOUR-IP-HERE and change it to the IP to load the code from when in Debug mode on a device. You could use a service like ngrok to make this work from anywhere.

  NSURL *jsCodeLocation;

  // Loading JavaScript code
  #if DEBUG
    // For Debug build load from development server. Start the server from the repository root:
@iZaL
iZaL / generate-iOS-app-icons.sh
Created May 9, 2016 02:54 — forked from marcuswestin/generate-iOS-app-icons.sh
Generate all xcode 5 app icon sizes from one original large icon
mkdir -p generated
sips -Z 29 --out generated/iPhoneSettings-29x29.png sourceIcon.png
sips -Z 58 --out generated/[email protected] sourceIcon.png
sips -Z 80 --out generated/[email protected] sourceIcon.png
sips -Z 120 --out generated/[email protected] sourceIcon.png
sips -Z 29 --out generated/iPadSettings-29x29.png sourceIcon.png
sips -Z 58 --out generated/[email protected] sourceIcon.png
sips -Z 40 --out generated/iPadSpotlight-40x40.png sourceIcon.png
@iZaL
iZaL / ex-navigation.md
Created December 20, 2016 14:05 — forked from knowbody/ex-navigation.md
My exponent's ex-navigation docs/thoughts

Exponent - ex-navigation

This is for now, for my personal use only, things might not be correctly explained here. For the official docs please check: https://github.com/exponentjs/ex-navigation/blob/master/README.md

Navigation bar configuration

On every screen you can use the built-in navigation bar, you can add a title, left button, right button or change navigation bar’s style. All you need to do is pass appropriate params to navigationBar in the route configuration:

import React, { Component } from 'react';
const walk = require('babylon-walk');
const babylon = require('babylon');
const glob = require('glob');
const fs = require('fs');
const path = require('path');
const zip = (a, b, fn) => a.forEach((el, i) => fn(el, b[i], i));
const promisify = fn => new Promise((res, rej) => {
const done = (err, val) => (err ? rej(err) : res(val));
@iZaL
iZaL / index.html
Created July 9, 2017 15:18 — forked from deltaepsilon/index.html
Firebase 3.0 Authentication Demo
<!--
Install dependencies with Bower:
bower install PolymerElements/paper-elements#^1.0.7
-->
<html>
<head>
<title>Auth Example</title>
<link rel="shortcut icon" href="/favicon.png" type="image/x-icon">
@iZaL
iZaL / FlowReactTutorial.js
Created November 27, 2017 08:05 — forked from busypeoples/FlowReactTutorial.js
Flow Fundamentals For ReactJS Developers
// @flow
// Flow Fundamentals For ReactJS Developers
/*
Tutorial for ReactJS Developers wanting to get started with FlowType.
We will go through the basic Flow features to gain a better understanding of how to use FlowType with React.
You can uncomment the features one by one and work through this tutorial.
If you want to learn the very FlowType basics, refer to "Flow Fundamentals for JavaScript Developers" (https://gist.github.com/busypeoples/61e83a1becc9ee9d498e0db324fc641b) first.
@iZaL
iZaL / NewMessage.php
Created January 17, 2018 13:16 — forked from sebastiaanluca/NewMessage.php
Laravel + Redis + NodeJS + Socket.io pub/sub secure server and client supporting multiple rooms, channels, users, … Add `client.js` to your client app, run `node server.js`, and trigger the Laravel event any way you want to broadcast the data.
<?php
namespace App\Events;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Queue\SerializesModels;
class NewMessage extends Event implements ShouldBroadcast
{
@iZaL
iZaL / countries.sql
Created August 27, 2019 09:51 — forked from adhipg/countries.sql
Sql dump of all the Countries, Country Codes, Phone codes.
CREATE TABLE IF NOT EXISTS `country` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`iso` char(2) NOT NULL,
`name` varchar(80) NOT NULL,
`nicename` varchar(80) NOT NULL,
`iso3` char(3) DEFAULT NULL,
`numcode` smallint(6) DEFAULT NULL,
`phonecode` int(5) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
@iZaL
iZaL / Laravel-Container.md
Created October 25, 2019 19:00
Laravel's Dependency Injection Container in Depth

Laravel's Dependency Injection Container in Depth

Translations: Korean (by Yongwoo Lee)

Laravel has a powerful Inversion of Control (IoC) / Dependency Injection (DI) Container. Unfortunately the official documentation doesn't cover all of the available functionality, so I decided to experiment with it and document it for myself. The following is based on Laravel 5.4.26 - other versions may vary.

Introduction to Dependency Injection

I won't attempt to explain the principles behind DI / IoC here - if you're not familiar with them you might want to read What is Dependency Injection? by Fabien Potencier (creator of the Symfony framework).