Skip to content

Instantly share code, notes, and snippets.

View mainiak's full-sized avatar

Jakub Viták mainiak

View GitHub Profile
@dwtkns
dwtkns / README.md
Last active March 28, 2023 23:31
Faux-3D Arcs

Building on this - experimenting with fake 3d svg arcs using two nested orthographic projections and cardinal line interpolation.

@holms
holms / gist:5005629
Last active September 16, 2024 22:52
midnight commander dark color theme
Edit mc’s ini file (either ~/.mc/ini or ~/.config/mc/ini) and look for the line [Colors]. Then, change the line base_color to this:
[Colors]
base_color=linux:normal=white,black:marked=yellow,black:input=,green:menu=black:menusel=white:menuhot=red,:menuhotsel=black,red:dfocus=white,black:dhotnormal=white,black:dhotfocus=white,black:executable=,black:directory=white,black:link=white,black:device=white,black:special=white,black:core=,black:stalelink=red,black:editnormal=white,black
@mhlavac
mhlavac / devel2013.md
Created March 3, 2013 10:12
My notes from devel 2013 conference

EsteJS - javascriptové aplikace robusně, modulárně a komfortně Daniel Steigerwald

  • Grunt - The JavaScript Task Runner
  • Bower - A package manager for the web
  • Component - Component package manager for building a better web.
  • AngularJS - MVC Javascript framework
  • Sencha, Dojo...

Kinohled.cz za 2 týdny Vojtěch Semecký

@fczbkk
fczbkk / ajax.js
Created March 25, 2013 07:06
Minimalist AJAX function for the most basic calls. Only supports GET method. Loads given url and sends result to the callback function. Callback attribute is optional, sometimes you just want to ping the server and you don't care about the response.
function ajax (url, callback) {
callback = callback || function () {};
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
callback(xhr.responseText);
}
};
xhr.open("GET", url, true);
xhr.send();
@fczbkk
fczbkk / get-random-string.js
Created March 25, 2013 12:29
Generates a random string and returns them or sends it to callback. Great for generating unique identifiers.
/*
Has two optional options parameters:
- length - 8 characters by default
- characters - upper- and lowercase characters and numbers by default
*/
function getRandomString(options, callback) {
options = options || {};
options.length = options.length || 8;
options.characters = options.characters || '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
@redcap3000
redcap3000 / nodejs-custom-version-openshift-installer.sh
Last active December 15, 2015 19:29
File that loads git://github.com/openshift/nodejs-custom-version-openshift.git in to an openshift app repo. Supply with path to existing openshift repo, or move script into repo root
#!/bin/bash
## Nodejs custom version installer
##
## Ronaldo Barbachano April 2013
## Based on the openshift/nodejscustom-version-openshift repo
##
## Supply with path to existing openshift repo, or move script into
## repo root.
##
## Probably less headaches if this is run immediately after
@3rd-Eden
3rd-Eden / app.js
Last active December 16, 2015 06:59
simple socket htingy
var http = require('http');
var server = http.createServer(function (req, res) {
res.statusCode = 200;
res.end('<script src="/socket.io/socket.io.js"></script>');
});
var io = require('socket.io').listen(server);
io.sockets.on('connection', function (socket) {
@bradoyler
bradoyler / mapReduce-WordCounter.js
Last active November 6, 2022 01:45
Using Map-Reduce in Javascript: counting words in a string.
// for counting words in a string
var words="Hi there and hello there. Welcome and hello there.";
var wordcnt = words.replace(/[^\w\s]/g, "").split(/\s+/).reduce(function(map, word){
map[word] = (map[word]||0)+1;
return map;
}, Object.create(null));
@synaptiko
synaptiko / 8188eu.ko
Last active May 1, 2019 20:23
Useful links related to "hard" linux things when I was experimenting with Raspberry Pi, cross-compilation, emulation etc.
@mosladil
mosladil / getUserTrafficQuota.php
Last active December 18, 2015 02:48
Kerio Control - Get user traffic quota
<?php
/**
* Kerio Control - Sample Application.
*
* STATUS: In progress, might change in the future
*
* This api is currently under development.
* The api is not intended for stable use yet.
* Functionality might not be fully verified, documented, or even supported.
*