Skip to content

Instantly share code, notes, and snippets.

View ilmoeuro's full-sized avatar

Ilmo Euro ilmoeuro

View GitHub Profile
@ilmoeuro
ilmoeuro / git.bat
Last active February 20, 2018 11:45
:: You can name this file <anything>.bat, and it will execute the corresponding program, eg. mvn.bat
@powershell -executionpolicy bypass -file "%~dp0ps-wsl-wrapper.ps1" %~n0 %*
. . . . . . . . . .
. . . . . . . . .
. . . . . . . . . .
. . . . . . . . .
@ilmoeuro
ilmoeuro / gist:e4fc285aa27506515f90b72d5c3289d3
Created December 14, 2017 12:16
execution of time counter program
Code:
a) initialize variables min, mid, hr
b) read variable values from user input
c) while hr <= 23
c1) while min <= 59
c1.1) output hr, mid, min
c1.2) increment min
c2) set min = 0
c3) increment hr
d) print "00" mid "00 you are in the matrix"
#include <iostream>
using namespace std;
int main()
{
for (int y=1;y<=10;y++)
{
int x = y * 2;
cout << "2 x " << y << " = " << x << endl;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<canvas id="canvas" style="width:100vw; height:100vh;"></canvas>
<button id="undo" style="position: absolute; left: 10px; top: 10px;">Undo</button>
document.addEventListener("deviceready", function() {
if (!localStorage.getItem("coords")) {
$.ajax({
url:"https://cloud.estimote.com/v2/devices/",
headers:{authorization:`Basic ${btoa('long:str')}`},
success:function(beacons) {
console.log(JSON.stringify(beacons));
$.each(beacons, function(k, v) {
$.ajax({
url:"https://cloud.estimote.com/v2/devices/"+v.identifier,
#!/usr/bin/env python3
with open(__file__, "a") as myfile:
myfile.write("\nprint('hi there!')")
@ilmoeuro
ilmoeuro / example.sh
Last active September 11, 2017 12:42
$ mkfifo input
$ mkfifo output
$ python3 <input >output
$ echo "print('hello world')" >input
$ cat output
hello world
class User:
# ...
def __init__(self, email_address, mail_service):
self.email_address = email_address
self.mail_service = mail_service
def send_mail(self, content):
# ...
self.mail_service.send_mail(self.email_address, content)
@ilmoeuro
ilmoeuro / annotationbug.ceylon
Created August 13, 2017 17:13
Code that demonstrates Ceylon annotation bug
/* Copyright 2017 Ilmo Euro
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,