Skip to content

Instantly share code, notes, and snippets.

@doup
doup / bevy-7761.html
Created March 9, 2023 08:53
Bevy #7761 `text_wrap_debug.rs`
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Bevy #7761 example</title>
<style>
/* Reset */
* {
@doup
doup / app.module.ts.md
Last active November 6, 2020 12:54
`ngx-translate` cache busting
+ // This value will be injected by Webpack
+ declare const I18N_HASH: string;

export function createTranslateLoader(http: HttpClient) {
- return new TranslateHttpLoader(http, './assets/i18n/', '.json');
+ return new TranslateHttpLoader(http, './assets/i18n/', '.json?v=' + I18N_HASH);
}
@doup
doup / 00_example.php
Last active April 30, 2017 13:54
CarbonFields Transformer to get & cast values from a container
<?php
// Define the theme container
use \Carbon_Fields\Container;
use \Carbon_Fields\Field;
$theme_container = Container::make('theme_options', 'Theme')->add_fields([
Field::make('text', 'analytics_id', 'Google Analytics tracking ID'),
Field::make('text', 'maps_api_key', 'Google Maps API Key'),
// ...
]);
@doup
doup / keybase.md
Created January 12, 2017 18:43
keybase.md

Keybase proof

I hereby claim:

  • I am doup on github.
  • I am doup (https://keybase.io/doup) on keybase.
  • I have a public key ASBQesR9H0meF424Hll015NaP6uLGAJ__yAMISbgQoR7FQo

To claim this, I am signing this object:

@doup
doup / inspect.html
Created October 24, 2016 18:47
Chrome/Firefox element inspects element detection & bounding box
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Inspector</title>
<meta name="description" content="The HTML5 Herald">
<meta name="author" content="SitePoint">
<style>
body {
width: 50%;
@doup
doup / todo.md
Last active October 27, 2016 21:54
Markdown TODO example

Example:

  • foo
  • bar
@doup
doup / app.js
Last active August 29, 2015 14:00
Answer to StackOverflow question: "SetInterval(), ClearInterval() timer questions for javascript" – http://stackoverflow.com/questions/23257873/setinterval-clearinterval-timer-questions-for-javascript/23258830#23258830
$(function () {
var rounds = 3;
var states = ['work', 'rest', 'wait'];
var lengths = [3, 1, 2]; // In seconds
var start = $('#start');
var stop = $('#stop');
var stats = $('#stats');
var roundEl = $('#round');
var stateEl = $('#state');
var cronoEl = $('#crono');
@doup
doup / 00-app.css
Last active December 21, 2015 18:22
Percolade Blog - "The future of javascript animation with Famo.us" on Famo.us 0.1.1
/*
* Percolade Blog - "The future of javascript animation with Famo.us"
* http://blog.percolatestudio.com/engineering/the-future-of-javascript-animation-with-famous/
* working code examples on Famo.us 0.1.1
*/
.test-surface {
background-color: #EBEBF1;
font-family: "Helvetica Neue", Helvetica, sans-serif;
font-weight: 300;
padding: 20px;
<?php
namespace App\EventBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Illarra\ContentBundle\Entity\Image as BaseImage;
/**
* @ORM\Entity(repositoryClass="Illarra\ContentBundle\Repository\Image")
* @ORM\Table(name="event_image")
@doup
doup / index.html
Created August 6, 2013 17:03
Example of AngularJS $http loading global variable
<!-- use $root.loading -->