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 | |
/** | |
* | |
* Implementation of sample scenario using MailZ API: | |
* | |
* Send message | |
* Show message status | |
* | |
* @author Pawel Chalkowski |
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
//FightCode can only understand your robot | |
//if its class is called Robot | |
var Robot = function(robot) { | |
}; | |
Robot.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
robot.rotateCannon(360); |
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
// ==UserScript== | |
// @name Panel weeb.tv | |
// @namespace weeb.tv | |
// @version 0.1 | |
// @description Skrypt poprawia wyświetlanie widoku programu na weeb.tv | |
// @author Chauek | |
// @match http://weeb.tv/online/* | |
// @match http://weeb.tv/channel/* | |
// @grant none | |
// ==/UserScript== |
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
// 1. Write a code snippet that sets a to an array of n random integers between 0 | |
// (inclusive) and n (exclusive). | |
var a = new Array[Int](10) //> a : Array[Int] = Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0) | |
for(i <- 0 until a.length) a(i) = scala.util.Random.nextInt(10) | |
a //> res0: Array[Int] = Array(9, 0, 5, 8, 6, 6, 3, 9, 0, 3) | |
// 2. Write a loop that swaps adjacent elements of an array of integers. For example, | |
// Array(1, 2, 3, 4, 5) becomes Array(2, 1, 4, 3, 5). | |
a = Array[Int](1,2,3,4,5) | |
a //> res1: Array[Int] = Array(1, 2, 3, 4, 5) |
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
function saveAs(uri, filename) { | |
var link = document.createElement('a'); | |
if (typeof link.download === 'string') { | |
link.href = uri; | |
link.download = filename; | |
//Firefox requires the link to be in the body | |
document.body.appendChild(link); | |
//simulate click |
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
#!/bin/bash | |
# Install ffmpeg on OSX | |
# brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-libass --with-libvorbis --with-libvpx --with-opus --with-x265 | |
IFS=$'\n' | |
FILES=$(find . -iname "*.mp4" -o -iname "*.avi" -o -iname "*.MPG" -o -iname "*.MTS" -o -iname "*.mkv" | grep -v -E "_x26[4-5].mp4" | grep -v -E "_x26[4-5].avi") | |
AMOUNT=$(echo "$FILES" | sed '/^\s*$/d' | wc -l) | |
AMOUNT="$(echo -e "${AMOUNT}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')" |
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
#!/bin/bash | |
# Install ffmpeg on OSX: | |
# brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-libass --with-libvorbis --with-libvpx --with-opus --with-x265 | |
IFS=$'\n' | |
WATCHER_PORT=9998 | |
LINE="" | |
PERCENT=0 |