Skip to content

Instantly share code, notes, and snippets.

View billhance's full-sized avatar

Bill Hance billhance

  • Startup
  • Los Angeles
View GitHub Profile

Write a markdown tutorial with code examples to get started with OpenAI’s completion API in a modern symfony 5 web application with full static typing. The main example is about having GPT-3 generate a markdown tutorial.

@Warkanlock
Warkanlock / marketplace.sol
Created February 26, 2022 04:05 — forked from dabit3/marketplace.sol
NFT Marketplace Smart Contract
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.3;
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "hardhat/console.sol";
@bjo3rnf
bjo3rnf / example_form.html.twig
Last active November 14, 2023 08:52
Stimulus.js controller for Symfony collection form type with configurable item limit
{% macro collection_item(form) %}
<div data-form-collection-target="field">
{{ form_widget(form) }}
<button type="button"
data-action="form-collection#removeItem">
remove
</button>
</div>
{% endmacro %}
@billhance
billhance / README.md
Created August 10, 2018 04:10 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.

OP: @leonardofed founder @ plainflow.


@pwm
pwm / datetime_wtf.php
Last active March 30, 2018 04:38
Datetimes are hard to get right...
<?php
/*
* The timezone in these datetimes look the same but they are in fact represent different UTC offsets.
* The 1st one maps to UTC+01 (BST) while the 2nd one maps to a UTC+00 (GMT).
* This is because daylight saving time (DST) aka. clocks going forward/backward happen on different days in different years.
*/
$now = new DateTime('2018-03-26T08:00:00', new DateTimeZone('Europe/London'));
$inAYear = new DateTime('2019-03-26T08:00:00', new DateTimeZone('Europe/London'));
@marinsagovac
marinsagovac / Mailhog + Symfony 3
Last active March 29, 2021 19:37
Mailhog + Symfony 3
$message = \Swift_Message::newInstance()
->setSubject('Hello Email')
->setFrom('send@example.com')
->setTo('recipient@example.com')
->setBody('You should see me from the profiler!')
;
$this->get('mailer')->send($message);
@anvk
anvk / psql_useful_stat_queries.sql
Last active July 12, 2024 11:28
List of some useful Stat Queries for PSQL
--- PSQL queries which also duplicated from https://github.com/anvk/AwesomePSQLList/blob/master/README.md
--- some of them taken from https://www.slideshare.net/alexeylesovsky/deep-dive-into-postgresql-statistics-54594192
-- I'm not an expert in PSQL. Just a developer who is trying to accumulate useful stat queries which could potentially explain problems in your Postgres DB.
------------
-- Basics --
------------
-- Get indexes of tables
@kellyrmilligan
kellyrmilligan / s3Sync.sh
Created June 8, 2017 13:38
Sync files to s3 and set cache control headers
#!/bin/bash
if [[ "$1" != "" ]]; then
S3BUCKETNAME="$1"
else
echo ERROR: Failed to supply S3 bucket name
exit 1
fi
aws s3 sync build s3://$S3BUCKETNAME --delete --cache-control max-age=31536000,public
@jonico
jonico / Jenkinsfile
Last active May 11, 2024 09:58
Example for a full blown Jenkins pipeline script with CodeQL analysis steps, multiple stages, Kubernetes templates, shared volumes, input steps, injected credentials, heroku deploy, sonarqube and artifactory integration, Docker containers, multiple Git commit statuses, PR merge vs branch build detection, REST API calls to GitHub deployment API, …
#!groovy
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
def label = "mypod-${UUID.randomUUID().toString()}"
podTemplate(label: label, yaml: """
spec:
containers:
- name: mvn
image: maven:3.3.9-jdk-8
exports.handler = function(event, context) {
// We'd get this from the Lambda event in reality
var sampleInput = {
from: 1,
to: 39,
bucketName: 'test-bucket',
imageSizes: [{
width: 600,
height: 400,
description: 'A medium thumbnail',