Skip to content

Instantly share code, notes, and snippets.

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

ahmadhasyim lordhasyim

🏠
Working from home
View GitHub Profile
@eusonlito
eusonlito / README.md
Last active March 15, 2024 15:01
Laravel Auth and Session without database. Using a remote API as Auth and Data provider.

This is an example of a web that uses a remote API as a database wrapper.

The remote API is stateless and the web uses cookies to maintain session persistence.

The API authentication endpoint returns a TOKEN that allows the web to make each request to the API with the user authentication header.


Este es un ejemplo de web que usa una API remota como wrapper de base de datos.

@ankurk91
ankurk91 / 1-elementary-os-apps.md
Last active December 25, 2023 19:14
elementary OS 5.1 Hera

elementaryOS Apps and Configs

⚠️ No longer maintained! ⚠️

This guide has been updated for elementaryOS v5.0+.

Enbale PPA support

sudo apt-get update
sudo apt-get -y install software-properties-common
<?php
/**
* Created by PhpStorm.
* User: oLDu67
* Date: 19.09.2017
* Time: 10:44
*
* @param array $inputs
* @param array|null $excepts
*
@mpaxson
mpaxson / WindowsCommandPromptAsciiArt.txt
Last active September 30, 2020 06:15
Windows Command Prompt Ascii Art
:: add this to the cmder/config/user-profile.cmd
::meme intro
:: this is to change starting directory to another drive
::@set USERPROFILE="F:\KettleOfHacks";
::@F:
:: @cd F:\KettleOfHacks\Work
@cls
@echo off
@altayalp
altayalp / Classes.php
Created July 31, 2016 12:36
Php facade design pattern simple and complete example with dependency injection
<?php
class Validate implements ValidateInterface
{
public function isValid(array $data)
{
return true;
}
}
class Auth implements AuthInterface
@banghasan
banghasan / PertamaBot.php
Last active December 23, 2022 14:52
Sample Bot Telegram - PHP
<?php
/*
BOT PENGANTAR
Materi EBOOK: Membuat Sendiri Bot Telegram dengan PHP
Ebook live http://telegram.banghasan.com/
oleh: bang Hasan HS
@diegonobre
diegonobre / symfony3-rest-api.md
Last active January 5, 2024 14:36 — forked from tjamps/README.md
Basic RESTful API with Symfony 3 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

Basic RESTful API with Symfony 3 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

The API we are creating in this gist will follow these rules :

  • The API only returns JSON responses
  • All API routes require authenticationu
  • Authentication is handled via OAuth2 with password Grant Type only (no need for Authorization pages and such).
  • API versioning is managed via a subdomain (e.g. v1.api.example.com)

The API will be written in PHP with the Symfony 3 framework. The following SF2 bundles are used :

@nivv
nivv / PHP 7 - Installing imagick on Ubuntu 14.04.md
Last active November 28, 2021 11:38
Guide - Enable imagick on PHP7

Guide

Note The extension Imagick is now included in Ondrej's PPA. All you need to do now is $ sudo apt-get install php-imagick, and you're done. I'll keep the guide here because a lot of it is still true for other extensions

======

I've installed PHP7 via Ondrej's PPA. He maintains these PPA's on his free time, consider donating

Install dependencies

@max-mapper
max-mapper / 0.md
Last active February 25, 2024 12:24
JS hoisting by example

JavaScript function hoisting by example

Below are many examples of function hoisting behavior in JavaScript. Ones marked as works successfuly print 'hi!' without errors.

To play around with these examples (recommended) clone them with git and execute them with e.g. node a.js

Notes on hoisting

(I may be using incorrect terms below, please forgive me)

<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="red_50">#fde0dc</color>
<color name="red_100">#f9bdbb</color>
<color name="red_200">#f69988</color>
<color name="red_300">#f36c60</color>
<color name="red_400">#e84e40</color>
<color name="red_500">#e51c23</color>
<color name="red_600">#dd191d</color>
<color name="red_700">#d01716</color>