Skip to content

Instantly share code, notes, and snippets.

View hgrimelid's full-sized avatar

Håvard Grimelid hgrimelid

  • Mediebruket
  • Norway
  • 21:25 (UTC +02:00)
View GitHub Profile
@drfraker
drfraker / Live Template For PHPUnit Tests
Last active June 7, 2024 09:53
Live Template For PHPUnit Tests
// 1. In PhpStorm go to: Preferences > Editor > Live Templates.
// 2. Click on the + button on the top right to create a new template.
// 3. Enter "@test" (no quotes) in the Abbreviation field, and give the template a name. (mine is named test case)
// 4. Copy and paste the code below into the "Template text:" section in PhpStorm
/** @test */
$NAME$
public function $SNAKENAME$()
{
$END$
@hjertnes
hjertnes / doom.txt
Created April 6, 2018 08:28
Doom Emacs Cheatsheet
SPC
SPC: find file
, switch buffer
. browse files
: MX
; EX
< switch buffer
` eval
u universal arg
x pop up scratch
@calebporzio
calebporzio / composer_versions_cheatsheet.md
Last active September 30, 2024 08:58
Composer version symbol cheatsheet
...
"require": {
    "vendor/package": "1.3.2", // exactly 1.3.2 (exact)

    // >, <, >=, <= | specify upper / lower bounds
    "vendor/package": ">=1.3.2", // anything above or equal to 1.3.2
    "vendor/package": "<1.3.2", // anything below 1.3.2

 // * | wildcard
FROM ruby:2.3.3
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
RUN mkdir /app
WORKDIR /app
ADD Gemfile /app/Gemfile
ADD Gemfile.lock /app/Gemfile.lock
RUN bundle install
ADD . /app
EXPOSE 3000
CMD rails s -p 3000
@clhenrick
clhenrick / .block
Last active December 29, 2024 08:07
Custom tiles in Google Maps
license: apache-2.0
@moso
moso / app.js
Last active December 15, 2022 07:28
laravel-mix config
// jQuery import
global.jQuery = require('jquery');
var $ = global.jQuery;
window.$ = $;
// Bootstrap 4 depends on Popper.js
// Popper.js import
//import Popper from 'popper.js';
//window.Popper = Popper;
@chronon
chronon / ext.txt
Created February 18, 2017 15:38
List of docker-php-ext-install extension names
Possible values for ext-name:
bcmath
bz2
calendar
ctype
curl
dba
dom
enchant
@woganmay
woganmay / iam-policy.json
Created January 3, 2017 23:48
IAM policy to grant a user narrow access to one S3 bucket
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:ListBucket",
"s3:ListAllMyBuckets",
"s3:GetBucketLocation"
],
@retlehs
retlehs / sync-prod.sh
Last active January 26, 2022 03:48
WP-CLI aliases sync example
read -r -p "Would you really like to reset your development database and pull the latest from production? [y/N] " response
if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]]; then
wp @development db reset --yes &&
wp @production db export - > sql-dump-production.sql &&
wp @development db import sql-dump-production.sql &&
wp @development search-replace https://example.com https://example.dev
fi
@brianclogan
brianclogan / readme.md
Last active May 11, 2022 13:36
SENTRY WEBHOOK PUBLISH - FORGE

When using Laravel Forge with Sentry, I found that I wanted a way to, when Forge deployed a new update, alert sentry of a release.

Here is what I did.

Edit the deploy script and add:

VERSION='{"version":"'$(git log --pretty=format:'%H' -n 1)'"}'
curl {YOUR_SENTRY_URL_HERE}/ \
  -X POST \

-H 'Content-Type: application/json' \