Skip to content

Instantly share code, notes, and snippets.

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

Sumardi Shukor sumardi

🏠
Working from home
View GitHub Profile
@awcodes
awcodes / BlockSettings.php
Created November 13, 2022 14:52
Filament Block Settings
<?php
namespace App\Forms\Components;
use Filament\Forms\Components\Group;
class BlockSettings extends Group
{
protected string $view = 'filament.forms.components.block-settings';
@AAbosham
AAbosham / FilamentCardTableLayout.php
Last active March 15, 2024 03:06
Filament Card Table Layout
<?php
namespace App\Filament\Resources\Trip;
//...
class PlaceResource extends Resource
{
public static function table(Table $table): Table
{
return $table
@JustinByrne
JustinByrne / laravel-ci-cd-workflow.yml
Last active April 23, 2024 21:55
Github Action to test laravel and then compile the assets to a production branch
name: CI/CD workflow
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
testing:
@MustafaMagdi
MustafaMagdi / Container.php
Last active April 17, 2024 19:14 — forked from tlikai/container.php
PHP Dependency Injection Container
<?php
/**
* Class Container
*/
class Container
{
/**
* @var array
*/
@sloanlance
sloanlance / git-temporary-ignore.md
Last active March 2, 2024 01:32
git: A couple ways to temporarily ignore changed or new files without altering .gitignore.

There are times notifications aren't wanted about either a changed repo file or a new file that needs to be added to the repo. However, adding the name of the file to .gitignore might not be a good option, either. For example, locally-generated files that other users aren't likely to generate (e.g., files created by an editor) or files of experimental test code might not be appropriate to appear in a .gitignore file.

In those cases, use one of these solutions:

  1. If the file is a changed repo file

    Use the command:

    git update-index --assume-unchanged "$FILE"

Update: download the new Pokemon Go app - it fixes all of this. Download it, and reauth, and you should be set. The grant scopes and prompt are correct and visible now too! Now if only I could actually find a pikachu...

Pokemon tokens are requested with these understandable scopes:

@steipete
steipete / UITableViewMore.m
Last active January 29, 2018 14:19
Using the "More" button. Of course the simple way that Apple uses in Mail/iOS is not public. rdar://16600859
- (NSString *)tableView:(UITableView *)tableView titleForSwipeAccessoryButtonForRowAtIndexPath:(NSIndexPath *)indexPath {
return @"More";
}
- (void)tableView:(UITableView *)tableView swipeAccessoryButtonPushedForRowAtIndexPath:(NSIndexPath *)indexPath {
NSLog(@"I wanted to be a pretty public API, but then time ran out and they forgot me...");
// Hide the More/Delete menu.
[self setEditing:NO animated:YES];
}
@jbenet
jbenet / simple-git-branching-model.md
Last active April 9, 2024 03:31
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@messified
messified / php-interview.md
Last active August 8, 2023 12:03
PHP Engineer Interview: What you should know

PHP Developer Interview: What you should know

1. What’s the difference between " self " and " this " ?

Use $this to refer to the current object. Use self to refer to the current class. In other words, use $this->member for non-static members, use self::$member for static members.

Source: When to use self vs this -stackoverflow

import json
import urllib
import urllib2
import time
""" Nike plus activity log
https://developer.nike.com
Output:
-- May --