Skip to content

Instantly share code, notes, and snippets.

View warifp's full-sized avatar
:shipit:
Life is a nightmare with code, raised on ethics

Wahyu Purnomo warifp

:shipit:
Life is a nightmare with code, raised on ethics
View GitHub Profile
@krisanalfa
krisanalfa / KeyGenerateCommand.php
Last active September 25, 2023 17:25
Lumen Key Generator Commands
<?php
namespace App\Console\Commands;
use Illuminate\Support\Str;
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
class KeyGenerateCommand extends Command
{
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@denji
denji / README.md
Last active October 19, 2025 11:13 — forked from Cubixmeister/README.md
Simple Sentry docker-compose.yml
  1. Download docker-compose.yml to dir named sentry
  2. Change SENTRY_SECRET_KEY to random 32 char string
  3. Run docker-compose up -d
  4. Run docker-compose exec sentry sentry upgrade to setup database and create admin user
  5. (Optional) Run docker-compose exec sentry pip install sentry-slack if you want slack plugin, it can be done later
  6. Run docker-compose restart sentry
  7. Sentry is now running on public port 9000
@mneedham
mneedham / app.py
Last active June 4, 2024 18:09
Mapping Strava runs using Leaflet and Open Street Map
from flask import Flask
from flask import render_template
import csv
import json
app = Flask(__name__)
@app.route('/')
def my_runs():
runs = []
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active November 11, 2025 12:52
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

Run go install and

  • gogitlocalstats -add /path/to/folder will scan that folder and its subdirectories for repositories to scan
  • gogitlocalstats -email [email protected] will generate a CLI stats graph representing the last 6 months of activity for the passed email. You can configure the default in main.go, so you can run gogitlocalstats without parameters.

Being able to pass an email as param makes it possible to scan repos for collaborators activity as well.

License: CC BY-SA 4.0

@devfaysal
devfaysal / csv-to-json.php
Last active June 5, 2024 12:08
CSV to JSON
<?php
/*
* Converts CSV to JSON
* Example uses the csv file of this gist
*/
$feed="https://gist.githubusercontent.com/devfaysal/9143ca22afcbf252d521f5bf2bdc6194/raw/ec46f6c2017325345e7df2483d8829231049bce8/data.csv";
//Read the csv and return as array
$data = array_map('str_getcsv', file($feed));
//Get the first raw as the key
$keys = array_shift($data);
@muhghazaliakbar
muhghazaliakbar / AlphaDashDotRule.php
Created February 27, 2020 05:53
Laravel validation to validate alpha, dash, and dot.
<?php
namespace App\Rules;
use Illuminate\Contracts\Validation\Rule;
class AlphaDashDot implements Rule
{
/**
* Determine if the validation rule passes.
@mtvbrianking
mtvbrianking / redis.md
Last active June 17, 2025 00:27
Install Redis on Xampp - Windows

Redis

Linux

jdoe@home-pc:~# apt-get install redis-server
jdoe@home-pc:~# systemctl enable [email protected]
jdoe@home-pc:~# apt-get update
jdoe@home-pc:~# apt-cache pkgnames | grep php7.4
jdoe@home-pc:~# apt install php7.4-redis
@encryptblockr
encryptblockr / fastapi_app.py
Created May 14, 2021 21:11 — forked from nguqtruong/fastapi_app.py
Integrate Sentry to FastAPI
import os
from fastapi import FastAPI
from sentry_sdk.integrations.asgi import SentryAsgiMiddleware
import sentry_sdk
sentry_sdk.init(
dsn='your Sentry dns', # CHANGE HERE
environment=os.getenv('ENV', 'dev'), # You should read it from environment variable