This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { generatorHandler } from "@prisma/generator-helper"; | |
import fs from "node:fs/promises"; | |
import path from "node:path"; | |
const header = `// This file was generated by a custom prisma generator, do not edit manually.\n`; | |
generatorHandler({ | |
onManifest() { | |
return { | |
defaultOutput: "./enums/index.ts", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update dist | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Node.JS 12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- see if the file exists | |
function file_exists(file) | |
local f = io.open(file, "rb") | |
if f then f:close() end | |
return f ~= nil | |
end | |
-- 1. Replaces .md with .html | |
-- 2. Replaces absolute paths with relative ones | |
-- 3. Replaces folder links with links to their index / readme |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// bitset_iter.h v1.1.0 | |
// Copyright 2019, Diego Dagum | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
# Generate an AUTHORS file based on the output of git shortlog. It uses ABC | |
# order, strips out leading spaces and numbers, then filters out specific | |
# authors. | |
git shortlog -se \ | |
| perl -spe 's/^\s+\d+\s+//' \ | |
| sed -e '/^CommitSyncScript.*$/d' \ | |
> AUTHORS |
Removing the last commit
To remove the last commit from git, you can simply run git reset --hard HEAD^
If you are removing multiple commits from the top, you can run git reset --hard HEAD~2 to remove the last two commits. You can increase the number to remove even more commits.
If you want to "uncommit" the commits, but keep the changes around for reworking, remove the "--hard": git reset HEAD^
which will evict the commits from the branch and from the index, but leave the working tree around.
If you want to save the commits on a new branch name, then run git branch newbranchname
before doing the git reset.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
echo file_get_contents('http://tinyurl.com/api-create.php?url='.'http://www.example.com/'); | |
/* For example | |
http://tinyurl.com/api-create.php?url=http://www.fullondesign.co.uk/ | |
Would return: | |
http://tinyurl.com/d4px9f | |
*/ | |
?> |