Skip to content

Instantly share code, notes, and snippets.

View evitolins's full-sized avatar
🏠
Working from home

Eriks Vitolins evitolins

🏠
Working from home
View GitHub Profile
@evitolins
evitolins / curlPost_resultToHtml.sh
Last active December 24, 2015 08:19
Upload a file via Curl, and retrieve returned HTML.
curl -F "upload_filename=@/full/path/to/local/file.txt" -F "myotherqueryvar=queryvalue" -L http://198.101.215.168/upload.php > html_out.htm
@evitolins
evitolins / RandomCanvasContent.js
Last active December 23, 2015 00:19
Create random colored squares... marginally useful.
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
// Build Canvas
var canvas = document.createElement('canvas'),
ctx = canvas.getContext('2d'),
w = canvas.width,
h = canvas.height,
<!-- This is a Node+WebSocket powered demo to sync videos
across different browsers. This file is the client,
the other one is the Node server. Powered by Node and
http://github.com/miksago/node-websocket-server -->
<style>
.inactive { display: none; }
.active { display: block; }
</style>
<script>
@evitolins
evitolins / font-awesome-checkbox.js
Last active December 21, 2015 23:08
Checkbox UI using font awesome 4.0 checkbox icons.
// Handler for all checkboxes
function checkboxHandler(action, checked) {
switch (action) {
case "test1":
console.log("1", action, checked);
break;
case "test2":
console.log("2", action, checked);
break;
case "test3":