Skip to content

Instantly share code, notes, and snippets.

View Alxandr's full-sized avatar
⁉️
⁉️

Aleksander Heintz Alxandr

⁉️
⁉️
View GitHub Profile
@Alxandr
Alxandr / crazies.cs
Created June 5, 2014 08:10
Running a WinForms application from K
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Test
{
using System;
using System.IO;
using System.Reflection;
namespace Kake
{
class Bootstrap
{
delegate int EntryPoint(string[] args);
@Alxandr
Alxandr / gist:90e8626b810df85eb553
Created December 10, 2014 01:16
Async js loop
async function foo() {
try {
let result = [];
for (let value of await getValues()) {
let newVal = await asyncOperation(value);
console.log(newVal);
result.push(newVal);
}
return result;
} catch (e) {
@Alxandr
Alxandr / gist:df582a764aa736580e50
Created December 13, 2014 20:32
404 Error page in vNext
app.Use(next => async context =>
{
await next(context);
if(context.Response.ContentLength == null)
{
context.Response.StatusCode = 404;
var path = Path.Combine(_hostingEnvironment.WebRoot, "_error", "404.html");
var content = File.ReadAllText(path);
await context.Response.SendAsync(content, "text/html");
}
@Alxandr
Alxandr / asm.ps1
Created December 30, 2014 07:56
List all assembly architecture (.NET)
Get-ChildItem -Filter "*.dll" | ForEach-Object {
$a = [reflection.assemblyname]::GetAssemblyName($_.FullName).ProcessorArchitecture
Write-Host $a $_.Name
}
@Alxandr
Alxandr / (generated) test.js
Last active August 29, 2015 14:14
Source of generated code
var a$0 = 5;
var add$0 = _fun$0('add', 2, function add(_arg0$0, _arg1$0) {
var a$1 = _arg0$0, b$0 = _arg1$0;
return _op$0('+', a$1, b$0);
});
var add1$0 = _call$0(add$0, [1]);
var b$1 = _call$0(add1$0, [a$0]);
var _ref$0 = function () {
var testInner$0 = 15;
return _tupleCreate$0([
@Alxandr
Alxandr / http.js
Created March 22, 2015 01:38
Http client
import 'whatwg-fetch';
let uuid = 0;
function getCallbackName() {
// Note: This does not run in node without a DOM
// But, if you're in node, why are you using JSONP???
let name;
do {
name = `jsonp_callback_${uuid++}`;
export class AuthService {
constructor() {
this.token = null;
this.user = null;
}
isAuthenticated() {
if (this.user === null || this.token === null) {
return false;
}
@Alxandr
Alxandr / stylesheet.css
Created May 16, 2015 07:37
epub css file
/* Main */
@font-face {
font-family: "Griffin";
font-weight: normal;
font-style: normal;
src: url('../Fonts/Griffin.ttf');
}
@font-face {
{
"version": "1.0.0-beta-*",
"description": "Tiny F# web framework",
"authors": [ "Alxandr" ],
"owners": [ "Alxandr" ],
"tags": [ "" ],
"projectUrl": "https://github.com/YoloDev/Nini",
"dependencies": {
"YoloDev.Dnx.FSharp": { "type": "build", "version": "1.0.0-*" },