Skip to content

Instantly share code, notes, and snippets.

View gopalindians's full-sized avatar
🕶️
.

Gopal Sharma gopalindians

🕶️
.
View GitHub Profile
@gopalindians
gopalindians / 01-intro.md
Created April 20, 2016 00:49 — forked from dwayne/01-intro.md
My notes from the book "ng-book: The Complete Book on AngularJS by Ari Lerner".

Introduction

Author: Ari Lerner.

AngularJS offers a single framework that can be used to build dynamic, client-centric applications. It provides:

  • Module support
  • DOM manipulation
  • Animations
  • Templating
@gopalindians
gopalindians / README
Created November 12, 2016 00:36 — forked from rdebath/README
Original brainfuck distribution by Urban Müller
This archive contains the following programs:
bfc The compiler for the 'brainfuck' language (240 bytes!)
bfc.asm Source for the compiler
bfi The interpreter for the 'brainfuck' language
bfi.c Source for the interpreter (portable)
src/ Some example programs in 'brainfuck'
src/atoi.b Reads a number from stdin
src/div10.b Divides the number under the pointer by 10
src/hello.b The ubiquitous "Hello World!"
@gopalindians
gopalindians / run.php
Created January 1, 2017 09:54 — forked from greut/run.php
A web server in pure PHP (non-concurrent and concurrent)
#!/usr/bin/env php
<?php
$app = function($request) {
$body = <<<EOS
<!DOCTYPE html>
<html>
<meta charset=utf-8>
<title>Hello World!</title>
@gopalindians
gopalindians / HelloWorld.exs
Last active April 22, 2017 08:51
Getting started in Elixir 1.4.0
IO.puts "Hello World राम राम"
@gopalindians
gopalindians / IO.gets.exs
Last active April 22, 2017 09:38
IO.gets similar to stdin
IO.gets "Whats your name\n"
@gopalindians
gopalindians / Install-php7.md
Created February 7, 2016 00:36 — forked from hollodotme/Install-php7.md
Installing php7-fpm with phpredis extension on Ubuntu 14.04

Install php7.0-fpm

# remove php5 modules
apt-get autoremove --purge php5-*
# add php-7.0 source list by [Ondřej Surý](https://github.com/oerdnj)
add-apt-repository ppa:ondrej/php-7.0
# Update index
apt-get update
# Install php7.0-fpm with needed extensions
@gopalindians
gopalindians / AppServiceProvider.php
Created September 7, 2019 01:06
Updated app/Providers/AppServiceProvider.php
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
@gopalindians
gopalindians / google_doc_cms.php
Created September 16, 2019 14:26 — forked from xeoncross/google_doc_cms.php
Fetch a google doc, parse it, cache it, and display the content inside a webpage using PHP.
<?php
// Based on http://www.realisingdesigns.com/2009/10/29/using-google-docs-as-a-quick-and-easy-cms/
function getUrl($url, $expires = 5)
{
$cache_file = __DIR__ . '/cache/' . preg_replace('~\W+~', '-', $url) . '.txt';
if( ! is_dir(__DIR__ . '/cache') AND ! mkdir(__DIR__ . '/cache')) {
die('Please create /cache directory');
}
@gopalindians
gopalindians / google_doc_cms.php
Created September 16, 2019 14:26 — forked from xeoncross/google_doc_cms.php
Fetch a google doc, parse it, cache it, and display the content inside a webpage using PHP.
<?php
// Based on http://www.realisingdesigns.com/2009/10/29/using-google-docs-as-a-quick-and-easy-cms/
function getUrl($url, $expires = 5)
{
$cache_file = __DIR__ . '/cache/' . preg_replace('~\W+~', '-', $url) . '.txt';
if( ! is_dir(__DIR__ . '/cache') AND ! mkdir(__DIR__ . '/cache')) {
die('Please create /cache directory');
}
@gopalindians
gopalindians / index.php
Created September 7, 2019 01:02
Updated index.php file for shared hosting
<?php
define('LARAVEL_START', microtime(true));
require __DIR__.'/../hero_app_2056102019/vendor/autoload.php';
$app = require_once __DIR__.'/../hero_app_2056102019/bootstrap/app.php';