Skip to content

Instantly share code, notes, and snippets.

View tilast's full-sized avatar
🤓

Ihor Kroosh tilast

🤓
View GitHub Profile
dbd4792efe78a537191bebaafff323eed332f0194bf246f80893f9ccedc04e38
@tilast
tilast / python-cli.sh
Created April 26, 2016 09:19 — forked from nepsilon/3-python-module-you-can-use-on-cli.md
3 Python modules you can use directly on the CLI
# Start a local webserver to serve the file of your current directory on the LAN:
# Python version 2.x:
python -m SimpleHTTPServer
# Python version 3.x:
python3 -m http.server
#Start a local SMTP server to debug your app emails. Emails will be printed on stdout:
python -m smtpd -c DebuggingServer -n
#Parse and prettify a JSON string with:
class Karatsuba
attr_reader :ab, :cd, :result, :right_result, :multipliers
def right?
@right_result == @result
end
private
def initialize ab, cd, right_result
@right_result = right_result
var gulp = require('gulp');
var connect = require('gulp-connect');
gulp.task('serve', function () {
connect.server({
port: 3000
});
});
gulp.task('default', ['serve']);
#include <omp.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define N 10
int main()
{
srand(time(NULL));
#include <mpi.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <omp.h>
#include <time.h>
#define N 10
int main(int argc, char** argv) {
strToBase64: function(input){
var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',
result = '',
chr1, chr2, chr3,
enc1, enc2, enc3, enc4,
i = 0;
do {
chr1 = input.charCodeAt(i++);
chr2 = input.charCodeAt(i++);
#include <omp.h>
#include <stdio.h>
int num_threads, thread_id;
int main()
{
#pragma omp threadprivate(thread_id)
#pragma omp parallel
{
#define BUF_SIZE 10
#define NC 8
#define NP 3
#define MAX_RAND_INT 100
#define MIN_RAND_INT 0
#include <pthread.h>
#include <semaphore.h>
#include <stdio.h>
#include <stdlib.h>
(function(){
function* test() {
let data = yield getData();
console.log(data);
if(data > 30) {
yield foo();
} else {
console.log("Fail");
}