Skip to content

Instantly share code, notes, and snippets.

View ssi-anik's full-sized avatar
💻
Open to remote work!

Syed Sirajul Islam Anik ssi-anik

💻
Open to remote work!
View GitHub Profile
@bayareawebpro
bayareawebpro / ModelVuePropsExample.php
Last active November 16, 2017 17:29
Model Vue Props Example
<?php
//Your Model
protected $appends = [
'vue_props',
];
//Props Ancestor Attribute
public function getVuePropsAttribute(){
$props = (object) array();
@bayareawebpro
bayareawebpro / RecursiveCollections.php
Last active November 21, 2017 16:29
Convert Nested Arrays into Collections
<?php
use \Illuminate\Support\Collection;
Collection::macro('recursive', function () {
return $this->map(function ($value) {
if (is_array($value)) {
return collect($value)->recursive();
}
return $value;
});
package main
import (
"fmt"
"os"
)
func main() {
fmt.Println("hello...")
fmt.Println("MYVAR:", os.Getenv("MYVAR"))
anonymous
anonymous / closure.js
Created October 26, 2014 17:53
function OuterScope () {
var a = 0;
function add() { a += 1; }
function showA() { console.log(a); }
return [add, showA];
}
var result = OuterScope();
@WSAyan
WSAyan / HttpStatusCodes.java
Last active March 23, 2019 07:12
Java class with all the HTTP Status Codes.
/**
* Created by wahid.sadique on 5/5/2018.
*/
public final class HttpStatusCodes {
public static final int CONTINUE = 100;
public static final int SWITCHING_PROTOCOLS = 101;
public static final int PROCESSING = 102;
public static final int OK = 200;
@amir-rahnama
amir-rahnama / README.md
Last active June 5, 2019 14:07
A simple Webpack (with Dev Server) + Gulp Configuration + LiveReload + Babel to playground where you can code ES6 without the need for React

A simple Webpack + Gulpfile configuration wihtout any need for React.js that assumes you have the following project structure:

node_modules/ bower_components/ scripts/

Entry script is in scripts/entry.js

You should run gulp && gulp build-dev and you are good to go.

@swapnil-webonise
swapnil-webonise / PHP Extension
Created October 9, 2013 06:27
It is a simple PHP extension which covers functions like hello world,addition,greet me etc.
It is a Simple PHP extension
Important Urls
http://devzone.zend.com/303/extension-writing-part-i-introduction-to-php-and-zend/
http://devzone.zend.com/317/extension-writing-part-ii-parameters-arrays-and-zvals/
http://devzone.zend.com/446/extension-writing-part-iii-resources/
http://simonholywell.com/post/2010/09/15-excellent-resources-for-php-extension-development.html
http://php.webtutor.pl/en/2011/07/07/how-to-create-php-extensions-in-c-part-i-adding-simple-function/
@technoknol
technoknol / Enable CORS in Laravel 5.4.php
Created April 26, 2017 14:10
Enable CORS in laravel 5.4
<?php
# File: app\Http\Middleware\CORS.php
# Create file with below code in above location. And at the end of the file there are other instructions also.
# Please check.
namespace App\Http\Middleware;
use Closure;
class CORS {
@reinink
reinink / bootstrap.php
Created February 20, 2014 12:16
Using illuminate/container outside of Laravel
<?php
// Vendor includes
include $config->base_path . '/libraries/Vendor/autoload.php';
// Include configuration file
$config = include('../config.php');
// Create IoC container
$ioc = new \Illuminate\Container\Container;
@c0d0g3n
c0d0g3n / EditableContainer.jsx
Last active February 11, 2021 11:13
React: double click to edit, blur to save and exit.
import React from 'react'
import settings from '../settings.js'
import Field from '../styles/FieldStyle.jsx'
export default class EditableContainer extends React.Component {
constructor (props) {
super(props)
// init counter
this.count = 0