Skip to content

Instantly share code, notes, and snippets.

View return-none's full-sized avatar
🐍

Konstantin Pauk return-none

🐍
View GitHub Profile
// simple assert
function assertEqual(a, b) {
return a === b;
}
// input data
var spend = [
{
id: 1,
price: -120,
var chunked = function (items, per_chunk) {
return items.reduce(function (chunks, item) {
if (chunks[chunks.length-1].length === per_chunk) {
chunks.push([]);
}
chunks[chunks.length-1].push(item);
return chunks;
}, [[]]);
};
angular.module('myApp')
.directive('elastic', [
'$timeout',
function ($timeout) {
'use strict';
return {
restrict: 'A',
link: function ($scope, element) {
var resize = function () {
var isoCountries = {
'AF' : 'Afghanistan',
'AX' : 'Aland Islands',
'AL' : 'Albania',
'DZ' : 'Algeria',
'AS' : 'American Samoa',
'AD' : 'Andorra',
'AO' : 'Angola',
'AI' : 'Anguilla',
'AQ' : 'Antarctica',
from django.utils.crypto import get_random_string
chars = 'abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)'
print get_random_string(50, chars)
#!/usr/bin/env python
"""
Simple python HTTP server. Added nice messages.
Place to /usr/local/bin/serve, chmod and run. Provide port as second argument
TODO: handle port is busy excepion
"""
from sys import argv
import SimpleHTTPServer
angular.module('myApp', []).config(['$httpProvider', function($httpProvider) {
angular.extend($httpProvider.defaults, {
xsrfCookieName: 'csrftoken',
xsrfHeaderName: 'X-CSRFToken'
});
}]);
libtiff4-dev libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev
@return-none
return-none / mine.types
Created April 23, 2014 11:11
From Nginx
types {
text/html html htm shtml;
text/css css;
text/xml xml rss;
image/gif gif;
image/jpeg jpeg jpg;
application/x-javascript js;
application/atom+xml atom;
text/mathml mml;

rage-quit support for bash

HOW TO INSTALL

Put flip somewhere in your $PATH and chmod a+x it.

Copy fuck into ~/.bashrc.