A fish oneliner to delete the latest workflow runs of a repo.
Install the GitHub CLI and replace <owner>/<repository>
with your repository.
You can also change ?per_page=100
with the number of runs you want to delete.
A fish oneliner to delete the latest workflow runs of a repo.
Install the GitHub CLI and replace <owner>/<repository>
with your repository.
You can also change ?per_page=100
with the number of runs you want to delete.
#!/usr/bin/env php | |
<?php | |
/** | |
* Requirements: PHP installed via Homebrew on macOS. | |
* | |
* Installation: Copy the content of this file in `~/xdebug`. | |
* | |
* Usage: | |
* |
<?php | |
use Symfony\Component\Security\Core\Exception\AccessDeniedException; | |
use Symfony\Component\Security\Http\Firewall\AccessListener; | |
class ThrowerChecker | |
{ | |
public function isThrownByFirewall(AccessDeniedException $exception): bool | |
{ | |
// Walking through the stack frames and returning true if one of them is triggered by a specific class |
<?php | |
use Symfony\Component\DomCrawler\Crawler; | |
use Symfony\Component\HttpFoundation\RedirectResponse; | |
use Symfony\Component\HttpFoundation\Response; | |
/** | |
* Opens a response in the default browser. | |
*/ | |
function open_response(Response $response): void |
/vendor | |
composer.lock |
<?php | |
namespace App\Controller; | |
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; | |
use Symfony\Component\EventDispatcher\EventDispatcherInterface; | |
use Symfony\Component\HttpFoundation\RequestStack; | |
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent; | |
use Symfony\Component\HttpKernel\HttpKernelInterface; | |
use Symfony\Component\HttpKernel\KernelEvents; |
package com.example.example | |
import android.os.Bundle | |
import android.support.v7.app.AppCompatActivity | |
class MainActivity : AppCompatActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
package com.example.example | |
// ... | |
class ActsDbHelper(val context: Context) : SQLiteOpenHelper(context, DATABASE_NAME, null, DATABASE_VERSION) { | |
// private val preferences: SharedPreferences = ... | |
private fun installedDatabaseIsOutdated(): Boolean { | |
// ... |
package com.example.example | |
// ... | |
import android.content.SharedPreferences | |
class ActsDbHelper(val context: Context) : SQLiteOpenHelper(context, DATABASE_NAME, null, DATABASE_VERSION) { | |
private val preferences: SharedPreferences = context.getSharedPreferences( | |
"${context.packageName}.database_versions", | |
Context.MODE_PRIVATE |
package com.example.example | |
// ... | |
import java.io.File | |
import java.io.FileOutputStream | |
class ActsDbHelper(val context: Context) : SQLiteOpenHelper(context, DATABASE_NAME, null, DATABASE_VERSION) { | |
private fun installDatabaseFromAssets() { | |
val inputStream = context.assets.open("$ASSETS_PATH/$DATABASE_NAME.sqlite3") |