Provides an image from a respective URL
const Component = ({ src, alt, width = 320, height = 240, fallback }) => {
<!-- | |
Smooth scroller | |
Just add any scrollable container inside this component. | |
Dependencies: | |
This example depends on GSAP to perform scroll y position across many browsers. It could | |
be replaced by any function that resolves scroll position for all browsers to cover with. |
/** | |
Removes accents from strings. | |
Example: | |
stripAccents("Jânio Cássio") // outputs Janio Cassio | |
@param string The string to strip accents with | |
@return A new string with without accents. | |
*/ | |
function stripAccents(string) { |
// dead stupid simple i18n implementation | |
/** | |
* i18n function allows to pick a string from a json (could be yml as well) and render it based on language. | |
* | |
* Examples: | |
* ``` | |
* const enUS = i18n('en-us'); // load a function that provides all en-us strings. | |
* const ptBR = i18n('pt-br'); // load a function that provides all pt-br strings. | |
* |
Making gif loops from Openframeworks is really cool but, isn't simple as suppose to be.
Here are the steps I do to make that. Look almost the whole process are mostly mechanical and could be automated.
These steps are:
I hereby claim:
To claim this, I am signing this object:
color averageColor(PImage image) { | |
float r = 0; | |
float g = 0; | |
float b = 0; | |
int count = image.pixels.length; | |
int[] pixels = image.pixels; | |
for(int i = 0; i < count; i++) { | |
r += red(pixels[i]); |
// The MIT License (MIT) | |
// Copyright (c) 2016 Jan Cássio | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
// | |
// StringMask.swift | |
// StringMask | |
// | |
// Created by Jan Cássio on 8/19/16. | |
// Copyright © 2016 Jan Cassio. All rights reserved. | |
// | |
import Foundation |
#!/bin/sh | |
# Create a RAM disk with same perms as mountpoint | |
# Script based on http://itux.idev.pro/2012/04/iservice-speed-up-your-xcode-%D0%BD%D0%B5%D0%BA%D0%BE%D1%82%D0%BE%D1%80%D1%8B%D0%B5-%D1%81%D0%BF%D0%BE%D1%81%D0%BE%D0%B1%D1%8B/ with some additions | |
# Usage: sudo ./xcode_ramdisk.sh start | |
USERNAME=$(logname) | |
TMP_DIR="/private/tmp" | |
RUN_DIR="/var/run" | |
SYS_CACHES_DIR="/Library/Caches" |