Skip to content

Instantly share code, notes, and snippets.

Coding Hard

Jonathan Goode u01jmg3

Coding Hard
View GitHub Profile
gullyn / flappy.html
Last active Sep 28, 2022
Flappy bird in 205 bytes (improved!)
View flappy.html
<body onload=z=c.getContext`2d`,setInterval(`c.width=W=150,Y<W&&P<Y&Y<P+E|9<p?z.fillText(S++${Y=`,9,9|z.fillRect(p`}*0,Y-=--M${Y+Y},P+E,9,W),P))):p=M=Y=S=6,p=p-6||(P=S%E,W)`,E=49) onclick=M=9><canvas id=c>
zaratedev /
Created Aug 31, 2020
Github actions for Laravel dusk
stemar / varexport.php
Last active Aug 26, 2022
PHP var_export() with short array syntax (square brackets) indented 2 spaces.
View varexport.php
* PHP var_export() with short array syntax (square brackets) indented 2 spaces.
* NOTE: The only issue is when a string value has `=>\n[`, it will get converted to `=> [`
* @link
* @param mixed $expression
* @param bool $return
* @return string
davidpiesse / Schedulable.php
Last active Apr 22, 2022
Laravel Custom Class/Model Scheduling
View Schedulable.php
//Don't forget to change the namespace!
namespace App\Traits;
use Cron\CronExpression;
use Illuminate\Support\Carbon;
use Illuminate\Console\Scheduling\ManagesFrequencies;
trait Schedulable{
imbrish / MacroServiceProvider.php
Created Jan 30, 2018
Locale-aware & multi-key sorting of arrays
View MacroServiceProvider.php
namespace App\Providers;
use Illuminate\Support\Collection;
use Illuminate\Support\ServiceProvider;
class MacroServiceProvider extends ServiceProvider
ajdruff / fix-git-line-endings
Last active Sep 17, 2022
Forces all line endings to LF in your git repo.
View fix-git-line-endings
# Use this with or without the .gitattributes snippet with this Gist
# create a file, paste this in and run it.
# Why do you want this ? Because Git will see diffs between files shared between Linux and Windows due to differences in line ending handling ( Windows uses CRLF and Unix LF)
# This Gist normalizes handling by forcing everything to use Unix style.
# Fix Line Endings - Force All Line Endings to LF and Not Windows Default CR or CRLF
timelf123 / lower_bound.js
Created Sep 22, 2017 — forked from Gattermeier/lower_bound.js
Lower bound of Wilson score confidence interval for a Bernoulli parameter
View lower_bound.js
// Node.js implementation of Evan Miller's algorithm for ranking stuff based on upvotes:
const stats = require('simple-statistics')
const lower_bound = (upvotes, n = 0, confidence = 0.95) => {
if (n === 0) return 0
// for performance purposes you might consider memoize the calcuation for z
const z = stats.probit(1-(1-confidence)/2)
egmontkob /
Last active Sep 21, 2022
Hyperlinks in Terminal Emulators
fgilio / axios-catch-error.js
Last active Sep 16, 2022
Catch request errors with Axios
View axios-catch-error.js
* Handling Errors using async/await
* Has to be used inside an async function
try {
const response = await axios.get('');
// Success 🎉
} catch (error) {
// Error 😨
giordanocardillo / README.MD
Last active Sep 15, 2022
Remove Office 2016 Product Key
  1. Open a command prompt as Administrator
  2. In the command prompt, type the following:
  • Office 2016 (32-bit) on a 32-bit version of Windows

    cscript "C:\Program Files\Microsoft Office\Office16\OSPP.VBS" /dstatus

  • Office 2016 (32-bit) on a 64-bit version of Windows

    cscript "C:\Program Files (x86)\Microsoft Office\Office16\OSPP.VBS" /dstatus

  • Office 2016 (64-bit) on a 64-bit version of Windows