This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
tasks: | |
up: | |
desc: "Start up all of the containers" | |
aliases: [u, start] | |
cmds: | |
- cmd: docker-compose up -d | |
stop: | |
desc: "Stop all of the containers" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"level101":[ | |
{ | |
"lvl101_name": "Network_Basics", | |
"lvl101_type": "Online", | |
"lvl101_duration": 720 | |
}, | |
{ | |
"lvl101_name": "Intro_To_Software", | |
"lvl101_type": "On-Site", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Looks for unquoted keys in a json string and fixes them ie: {a:"b"} => {"a":"b"} | |
* @param string $string A json string that is suspect | |
* @return string A valid json string | |
*/ | |
function fix_json($string){ | |
// (no qupte) (word) (no quote) (semicolon) | |
$regex = '/(?<!")([a-zA-Z0-9_]+)(?!")(?=:)/i'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: | |
:: Formerly known as::: | |
:: GIFEncoder Version 2.0 by László Zsidi, http://gifs.hu | |
:: | |
:: This class is a rewritten 'GifMerge.class.php' version. | |
:: | |
:: Modification: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.my-form').submit(function(){ | |
var battery = window.navigator.battery.level <= 0.05; | |
var connectivity = window.navigator.onLine; | |
var msg = ''; | |
if(!battery){ | |
msg = "you should probably plug in your computer"; | |
} | |
if(!battery && !connectivity){ | |
msg += ", " | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @method void error() error(string $name, mixed $var) | |
* @method void exception() exception(string $name, mixed $var) | |
* @method void info() info(string $name, mixed $var) | |
* @method void log() log(string $name, mixed $var) | |
* @method void trace() trace(string $name, mixed $var) | |
* @method void warn() warn(string $name, mixed $var) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
usage: | |
cd /my/svn/repo | |
./path/to/svn2git-authors.sh > authors.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"title": "this is a title", | |
"content": "this is a body", | |
"date": "2009-01-01", | |
"url":"http://oldsite.com/123/test", | |
"image": "test.jpg", | |
"id": 1 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//made up x start positions... obviously, I think they are a pixel offset? | |
//days | |
$text = $interval->format('%D'); | |
imagettftext ($image , $font['size'] , $font['angle'] , 10 , $font['y-offset'] , $font['color'] , $font['file'], $text ); | |
//separator | |
$text = $interval->format(':'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Here an example using servlet 3.0 to upload file with file-uploader | |
*/ | |
package com.silyan.simplex.view.site.content; | |
import java.io.File; | |
import java.io.FileNotFoundException; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.io.InputStream; |
NewerOlder