This file contains hidden or 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
// clang --target=wasm32 -nostdlib -Os -Wl,--no-entry -Wl,--export-all add.cpp -o add.wasm | |
extern "C" int add(int x, int y) | |
{ | |
return x + y; | |
} |
This file contains hidden or 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
using Sandbox.Game.EntityComponents; | |
using Sandbox.ModAPI.Ingame; | |
using Sandbox.ModAPI.Interfaces; | |
using SpaceEngineers.Game.ModAPI.Ingame; | |
using System.Collections.Generic; | |
using System.Collections; | |
using System.Linq; | |
using System.Text; | |
using System; | |
using VRage.Collections; |
This file contains hidden or 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
#!/usr/bin/env node | |
"use strict"; | |
/* Copyright (C) 2017 Julien Hartmann, [email protected] | |
* | |
* This program is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or | |
* (at your option) any later version. | |
* | |
* This program is distributed in the hope that it will be useful, |
This file contains hidden or 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
#!/usr/bin/env python | |
import base64 | |
import hashlib | |
import subprocess | |
import sys | |
B32ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567' | |
def luhn_checksum(data, alphabet=B32ALPHABET): | |
n = len(alphabet) |
This file contains hidden or 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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName:'Ember Twiddle' | |
}); |
This file contains hidden or 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
# http://stackoverflow.com/questions/33601864 | |
products = { | |
'Cat1': { | |
'Prod1': { | |
'comment': 'ABC', | |
'indicator': 'Flat', | |
'pricelow': '10', | |
'priceaverage': '20', | |
'pricehigh': '30'}, |
This file contains hidden or 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
#!/usr/bin/env python | |
# See http://stackoverflow.com/questions/32885753/ | |
class BaseRequestProcessor(object): | |
# Template class. | |
# The request processor gets some query, parses it into a request, executes it | |
# then saves the result and writes some logging info. | |
def get_query(self): | |
raise NotImplementedError() |
This file contains hidden or 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
from django.conf import settings | |
from django.test.runner import DiscoverRunner | |
import os | |
# You'll need to adjust those | |
SUBPATHS = ('myproject/apps', 'myproject/libs') | |
ROOT = dirname(dirname(dirname(os.path.abspath(__file__)))) | |
class TestRunner(DiscoverRunner): | |
""" Adds submodules from not-importable folders to the test suite. |
This file contains hidden or 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
# Based on http://thebuild.com/blog/2010/12/13/very-large-result-sets-in-django-using-postgresql/ | |
# Allows a queryset. | |
# Does not support defer(), annotate(), select_related() or prefetch_related() | |
import django | |
from django.db import connection, transaction | |
assert django.VERSION[0:2] == (1, 8), "only tested on Django 1.8, make sure to test on your version" | |