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
#include <locale.h> | |
#include <stdio.h> | |
#include <wchar.h> | |
int main() { | |
wchar_t name[10]; | |
wcscpy(name, L"жажа"); | |
setlocale(LC_CTYPE, "en_US.UTF-8"); | |
wprintf(L"%S\n", name); |
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
template< class, class > | |
class Permutation; | |
template< class OUT_TYPE, class... IN_TYPES, uint32_t... INDEXES > | |
class Permutation< | |
std::function< OUT_TYPE (IN_TYPES...) >, // тип целевой функции | |
UintContainer< INDEXES... > > // перестановка аргументов | |
{ | |
public: | |
typedef std::function< OUT_TYPE (IN_TYPES...) > FuncType; | |
typedef std::function< OUT_TYPE (typename GetNthType< INDEXES, TypeContainer<IN_TYPES...> >::Result...) > NewFuncType; |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#define N (3) | |
const size_t offset = sizeof(char *) * N, | |
length = (sizeof(char *) + sizeof(char) * N) * N; | |
int main(int argc, char **argv) { | |
char **foo = (char **)malloc(length); |
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
description "uWSGI starter {ricchan}" | |
start on (local-filesystems | |
and runlevel [2345]) | |
stop on runlevel [016] | |
respawn | |
exec /usr/local/bin/uwsgi --uid rei \ | |
-s 127.0.0.1:9001 -M -p 2 \ |
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
for i in `cat ~/Documents/icons8.txt`; do find . -name "$i" -exec mv {} ~/Projects/icons8/ \;; done |
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
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 |
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
/* 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(); |
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
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') }) |
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
/* | |
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 |
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 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) |