Skip to content

Instantly share code, notes, and snippets.

View u01jmg3's full-sized avatar
🔷
Coding Hard

Jonathan Goode u01jmg3

🔷
Coding Hard
View GitHub Profile
@xuanlongma
xuanlongma / pandoc_multi_input.md
Last active March 22, 2024 21:49
Combine multiple input files when using Pandoc

If multiple input files are given, pandoc will concatenate them all (with blank lines between them) before parsing. -- from Pandoc website

Pandoc command: pandoc -s input1.md input2.md input3.md -o output.html

@paulirish
paulirish / rAF.js
Last active March 22, 2024 00:00
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
@hdragomir
hdragomir / sm-annotated.html
Last active March 5, 2024 08:57
The deferred font loading logic for Smashing Magazine. http://www.smashingmagazine.com/
<script type="text/javascript">
(function () {
"use strict";
// once cached, the css file is stored on the client forever unless
// the URL below is changed. Any change will invalidate the cache
var css_href = './index_files/web-fonts.css';
// a simple event handler wrapper
function on(el, ev, callback) {
if (el.addEventListener) {
el.addEventListener(ev, callback, false);
@ajdruff
ajdruff / fix-git-line-endings
Last active February 29, 2024 13:02
Forces all line endings to LF in your git repo.
#####################
#
# Use this with or without the .gitattributes snippet with this Gist
# create a fixle.sh 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
@zaratedev
zaratedev / .env.ci
Created August 31, 2020 18:55
Github actions for Laravel dusk
APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://127.0.0.1:8000
BCRYPT_ROUNDS=4
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
@paulirish
paulirish / data-markdown.user.js
Last active February 6, 2024 10:41
*[data-markdown] - use markdown, sometimes, in your HTML
// ==UserScript==
// @name Use Markdown, sometimes, in your HTML.
// @author Paul Irish <http://paulirish.com/>
// @link http://git.io/data-markdown
// @match *
// ==/UserScript==
// If you're not using this as a userscript just delete from this line up. It's cool, homey.
@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)
{
@mcaskill
mcaskill / Function.HTML-Build-Attributes.php
Last active January 8, 2024 04:14
PHP / WordPress : Generate a string of HTML attributes
<?php
if (!function_exists('html_build_attributes')) {
/**
* Generate a string of HTML attributes
*
* @param array $attr Associative array of attribute names and values.
* @param callable|null $callback Callback function to escape values for HTML attributes.
* Defaults to `htmlspecialchars()`.
* @return string Returns a string of HTML attributes.
@jed
jed / LICENSE.txt
Created May 20, 2011 13:27 — forked from 140bytes/LICENSE.txt
generate random UUIDs
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@gullyn
gullyn / flappy.html
Last active November 28, 2023 18:23
Flappy bird in 205 bytes (improved!)
<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>