Skip to content

Instantly share code, notes, and snippets.

я котик пур-пур mvasilkov

Block or report user

Report or block mvasilkov

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mvasilkov
mvasilkov / cemetery.sh
Created Jul 13, 2012
Shell commands cemetery ^^
View cemetery.sh
for i in `cat ~/Documents/icons8.txt`; do find . -name "$i" -exec mv {} ~/Projects/icons8/ \;; done
@mvasilkov
mvasilkov / Makefile
Created Sep 6, 2012
Makefile for Tako Neko :3
View Makefile
vx:
virtualenv vx
requirements: vx
vx/bin/pip install -r requirements.txt
test_modules = main users
test:
vx/bin/python manage.py test $(test_modules) -v2 --failfast
@mvasilkov
mvasilkov / foo.js
Created Oct 1, 2012
TypeScript as a JS pretty print tool
View foo.js
/* Original code */
var s = 'foo.bar', im = new Image
im.src = s; s = im.src
console.log(s)
/* TypeScript output */
var s = 'foo.bar';
var im = new Image();
@mvasilkov
mvasilkov / test.js
Created Oct 2, 2012
QUnit test with RequireJS (partial)
View test.js
define(['events'], function(events) {
module('events.js')
test('Basic methods', function() {
// `register` and `bind`
var str = 'Life is beautiful'
events.register('str_replace')
events.bind('str_replace', function() { str = str.replace('Life', 'Flower') })
View requestAnimationFrame.js
/*
requestAnimationFrame polyfill, by Mark Vasilkov
http://careers.stackoverflow.com/mvasilkov
Released into the public domain.
*/
if (typeof requestAnimationFrame === "undefined") {
["moz", "webkit", "ms"].some(function(p) {
var fun = this[p + "RequestAnimationFrame"]
if (typeof fun === "function") {
return requestAnimationFrame = fun
View failsystem.js
function everythingIsRuinedForever(error) {
console.log(error)
}
- function(filename) {
var quota = 1 << 24
webkitStorageInfo.requestQuota(PERSISTENT, quota, function(bytes) {
webkitRequestFileSystem(PERSISTENT, bytes, function(fs) {
console.log(fs.name)
View baka-baka.js
var obj = function() {}
obj.prototype.f = function(name) { if (this[name] === void 0) this[name] = new obj; return this[name] }
obj.prototype.get = function(name) { return this[name] }
obj.prototype.set = function(name, value) { this[name] = value }
// Usage:
var x = new obj
x.f("file").f("document").f("properties").set("т прнс?", true)
@mvasilkov
mvasilkov / baka.conf
Created Feb 7, 2013
./comment.sh baka.conf sendsms-user
View baka.conf
group = core
admin-port =
admin-password =
log-file = "/var/log/kannel/bearerbox.log"
log-level = 3
status-password =
access-log = "/var/log/kannel/access_kannel.log"
store-location = "/var/log/kannel/store_sms"
smsbox-port =
# dlr-storage = mysql
View package.json
{
"jam": {
"packageDir": "media/lib",
"baseUrl": "media",
"dependencies": {
"jquery": null,
"raphael": null
}
}
}
@mvasilkov
mvasilkov / array2d.c
Last active Dec 14, 2015
This is a demo of 2D arrays in C written for my (imaginary) friend.
View array2d.c
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char const *argv[])
{
int **array2d, n, i, j;
puts("Enter a number:");
scanf("%d", &n);
puts("Thank you, kind sir.");
You can’t perform that action at this time.