This is a summary of the "Learn You A Haskell" online book under http://learnyouahaskell.com/chapters.
- Haskell is a functional programming language.
| void HSV_to_RGB(float h, float s, float v, byte *r, byte *g, byte *b) | |
| { | |
| int i,f,p,q,t; | |
| h = max(0.0, min(360.0, h)); | |
| s = max(0.0, min(100.0, s)); | |
| v = max(0.0, min(100.0, v)); | |
| s /= 100; | |
| v /= 100; |
| /** | |
| * Provides requestAnimationFrame in a cross browser way. | |
| * @author paulirish / http://paulirish.com/ | |
| */ | |
| if ( !window.requestAnimationFrame ) { | |
| window.requestAnimationFrame = ( function() { | |
| return window.webkitRequestAnimationFrame || |
| @echo off | |
| setlocal enabledelayedexpansion | |
| if {%1}=={} ( | |
| echo Usage: %~nx0 [vhd] [letter] | |
| exit /b 1 | |
| ) | |
| set vhdPath=%~dpnx1 | |
| set driveLetter=%2 |
| <?php | |
| $fileName = $_FILES['afile']['name']; | |
| $fileType = $_FILES['afile']['type']; | |
| $fileContent = file_get_contents($_FILES['afile']['tmp_name']); | |
| $dataUrl = 'data:' . $fileType . ';base64,' . base64_encode($fileContent); | |
| $json = json_encode(array( | |
| 'name' => $fileName, | |
| 'type' => $fileType, | |
| 'dataUrl' => $dataUrl, |
| #!/bin/sh | |
| ### | |
| # SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
| # For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
| ### | |
| # Alot of these configs have been taken from the various places | |
| # on the web, most from here | |
| # https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |
This is a summary of the "Learn You A Haskell" online book under http://learnyouahaskell.com/chapters.
| echo -e "\e[1;40m" ; clear ; while :; do echo $LINES $COLUMNS $(( $RANDOM % $COLUMNS)) $(( $RANDOM % 72 )) ;sleep 0.05; done|awk '{ letters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*()"; c=$4; letter=substr(letters,c,1);a[$3]=0;for (x in a) {o=a[x];a[x]=a[x]+1; printf "\033[%s;%sH\033[2;32m%s",o,x,letter; printf "\033[%s;%sH\033[1;37m%s\033[0;0H",a[x],x,letter;if (a[x] >= $1) { a[x]=0; } }}' |
| <?php | |
| require_once 'abstract.php'; | |
| class Mage_Shell_CheckImages extends Mage_Shell_Abstract | |
| { | |
| const CATALOG_PRODUCT = '/catalog/product'; | |
| const CACHE = '/cache/'; | |
| protected function _glob_recursive($pattern, $flags = 0) |
| Spotify Alarm | |
| Utilizing [IFTT recipe](https://ifttt.com/recipes/283707-spotify-alarm-clock) | |
| In your mail client: | |
| Create a rule in your mail client with the following properties | |
| - Message content contains #wakeup | |
| - Actions: Delete Message, Run AppleScript | |
| Create an AppleScript with the following statements. |
| function *fibonacci(n) { | |
| const infinite = !n && n !== 0; | |
| let current = 0; | |
| let next = 1; | |
| while (infinite || n--) { | |
| yield current; | |
| [current, next] = [next, current + next]; | |
| } | |
| } |