Skip to content

Instantly share code, notes, and snippets.

@tap52384
tap52384 / README.md
Last active August 1, 2023 10:10
Install Windows on External Drive for macOS
@r-malon
r-malon / monokai.md
Created February 27, 2019 19:15
Monokai colors in RGB and HEX format, taken from Sublime Text 3

Monokai Colors in RGB and HEX format


  • Background: (46, 46, 46); #2e2e2e
  • Comments: (121, 121, 121); #797979
  • White: (214, 214, 214); #d6d6d6
  • Yellow: (229, 181, 103); #e5b567
  • Green: (180, 210, 115); #b4d273
  • Orange: (232, 125, 62); #e87d3e
  • Purple: (158, 134, 200); #9e86c8
@jeffersonmartin
jeffersonmartin / composer-private-package-github-token.md
Last active April 11, 2024 11:22
Generate a GitHub Personal Access Token for Private Composer Packages

Generate a GitHub Personal Access Token for Private Composer Packages

If you're trying to load a private repository with Composer/Laravel, we'll need to generate a GitHub Personal Access Token (similar to OAuth token) to access the repository during a composer install without entering credentials.

If you have used other Github packages from {my-org} before, you may be able to skip this step.

  1. Visit https://github.com/settings/tokens.

  2. Click Generate new token.

Installation

This procedure is tested on Mac OS X 10.14.0 with Xcode Developer Tools installed (xCode).

PHP 5.6, 7.0, 7.1, and 7.2 installed with Homebrew following the instructions here.

Preparation

Download the following files from Oracle website (yes, you need to create an account and accept terms):

@robertpainsi
robertpainsi / commit-message-guidelines.md
Last active April 22, 2024 16:05
Commit message guidelines

Commit Message Guidelines

Short (72 chars or less) summary

More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).

Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
@tap52384
tap52384 / php_html_validator.php
Last active January 15, 2016 15:12
Uses the official w3c validator to validate HTML snippets. The results are returned as a JSON string. Could be refactored, but it works as is.
/**
* Sends an HTML snippet to the W3C validator and returns the result as JSON.
* @param string $html HTML code
* @return string
* @link https://github.com/validator/validator/wiki/Service:-Input:-POST-body
* @link https://gist.github.com/tap52384/60cc27fd0a76869cc38b#file-php_html_validator-php
*/
public static function validateHtml($html = '')
{
$default = array(
@lemiant
lemiant / html5_audio_promises.js
Last active December 15, 2015 19:10
Handling HTML5 audio/video with jQuery promises
// This function plays an audio/video element and creates a promise
// that resolves when the audio/video finishes playing
// It's nice :)
function HTML5Play(target){
var t = $(target);
if(t.length != 1 || !t.is('audio, video')) return undefined; //These are invalid cases
var deferred = new $.Deferred();
t.on('ended', function(){ deferred.resolve(t) })
@JesseObrien
JesseObrien / gist:7418983
Last active January 31, 2024 06:24
Bind parameters into the SQL query for Laravel ORM
<?php
class MyModel extends Eloquent {
public function getSql()
{
$builder = $this->getBuilder();
$sql = $builder->toSql();
foreach($builder->getBindings() as $binding)
{
@mshafrir
mshafrir / states_hash.json
Created May 9, 2012 17:05
US states in JSON form
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",