Skip to content

Instantly share code, notes, and snippets.

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

Iftekher Islam Sunny IftekherSunny

🏠
Working from home
View GitHub Profile
// Element store
const elementStore = class ElementStore {
// set initial state
@observable path = null
@observable visible = false
@observable list = {}
// create a new instance of element store
constructor() {
this.list = sortElementsByName(elements)
@IftekherSunny
IftekherSunny / api.go
Created June 28, 2017 10:00 — forked from peterhellberg/api.go
A tiny example API written in Go using Martini and Redigo
package main
import (
"flag"
"fmt"
"net/http"
"github.com/codegangsta/martini"
"github.com/garyburd/redigo/redis"
"github.com/martini-contrib/render"
@IftekherSunny
IftekherSunny / GIFEncoder.class.php
Created June 20, 2017 04:39 — forked from SeanJA/GIFEncoder.class.php
dynamic animated gif clock
<?php
/*
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Formerly known as:::
:: GIFEncoder Version 2.0 by László Zsidi, http://gifs.hu
::
:: This class is a rewritten 'GifMerge.class.php' version.
::
:: Modification:
@IftekherSunny
IftekherSunny / main.go
Created January 3, 2017 05:21 — forked from cespare/main.go
Example of testing Go HTTP servers using httptest.Server.
package main
import (
"log"
"myserver"
"net/http"
)
const addr = "localhost:12345"
@IftekherSunny
IftekherSunny / GoMgoSample-1.go
Created January 1, 2017 13:23 — forked from ardan-bkennedy/GoMgoSample-1.go
Sample Go and MGO example
type (
// BuoyCondition contains information for an individual station.
BuoyCondition struct {
WindSpeed float64 `bson:"wind_speed_milehour"`
WindDirection int `bson:"wind_direction_degnorth"`
WindGust float64 `bson:"gust_wind_speed_milehour"`
}
// BuoyLocation contains the buoy's location.
BuoyLocation struct {
{
"Kwajalein":"(GMT-12:00) International Date Line West",
"Pacific\/Midway":"(GMT-11:00) Midway Island",
"Pacific\/Samoa":"(GMT-11:00) Samoa",
"Pacific\/Honolulu":"(GMT-10:00) Hawaii",
"America\/Anchorage":"(GMT-09:00) Alaska",
"America\/Los_Angeles":"(GMT-08:00) Pacific Time (US & Canada)",
"America\/Tijuana":"(GMT-08:00) Tijuana, Baja California",
"America\/Denver":"(GMT-07:00) Mountain Time (US & Canada)",
"America\/Chihuahua":"(GMT-07:00) Chihuahua",
@IftekherSunny
IftekherSunny / SubscribersTest.php
Last active February 2, 2022 11:29
Laravel File Upload API Test
<?php
use Illuminate\Http\UploadedFile;
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
class SubscribersTest extends TestCase
{
use DatabaseMigrations, WithoutMiddleware;
@IftekherSunny
IftekherSunny / HttpResponse.php
Last active August 9, 2016 09:37
Http response trait for the Laravel framework
<?php
trait HttpResponse
{
/**
* Response unprocessable entity.
*
* @param array $message
*
* @return \Illuminate\Http\JsonResponse
/******************************************************************************************
*
* Headers for cors.
*
*****************************************************************************************/
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, DELETE');
header('Access-Control-Allow-Headers: Content-Type, X-Auth-Token, Origin, Authorization');
@IftekherSunny
IftekherSunny / subscribers-list.blade.php
Last active August 2, 2016 09:29
VueJS - Table Mixnin
@extends('layouts.default')
@section('content')
<subscribers-list inline-template>
<div class="main">
<div class="container">
<div class="row">
<div class="row">
<!-- table top -->
<div class="col-md-6">