Skip to content

Instantly share code, notes, and snippets.

@goloveychuk
goloveychuk / main.swift
Created February 23, 2016 22:17
swift.swift
import cocilib
@_exported import SQL
enum OracleError: ErrorType {
case NotConnected
}
// //
// // main.swift
// // broq_swift
// //
// // Created by badim on 1/19/16.
// // Copyright © 2016 badim. All rights reserved.
// //
import SwiftZMQ
import ZeroMQ
import Venice
import Foundation
import C7
let context = try! Context()
struct Error: ErrorProtocol {
class Users: Views.Endpoint/View/Resource, Views.List, Views.Create, Views.Delete, Views.Update//for all just Views.Generic {
let model: Users
var queryset: QuerySet {//it should support paginate, filter, remove and other simple queries. Maybe this should be `d5` protocols
return Users.all
}
let filters: [User.id.eq, User.name.eq, User.created.range]
let authentication: [TokenAuthentication]
let serializerClass: UserSerializer
<script>
var clsName = "selected"
var list = document.getElementsByTagName("p")
for (var i in list) {
var el = list[i]
el.addEventListener("click", function () {
import ZeroMQ
import Venice
import Foundation
import C7
let context = try! Context()
struct Error: ErrorProtocol {
[at-loader]: Child process failed to process the request: TypeError: Cannot read property 'exports' of undefined
at resolveName (/Users/badim/github/orzo/orzo-frontend/node_modules/typescript/lib/typescript.js:26110:70)
at resolveEntityName (/Users/badim/github/orzo/orzo-frontend/node_modules/typescript/lib/typescript.js:26686:26)
at Object.getTypeReferenceSerializationKind (/Users/badim/github/orzo/orzo-frontend/node_modules/typescript/lib/typescript.js:45669:31)
at serializeTypeReferenceNode (/Users/badim/github/orzo/orzo-frontend/node_modules/typescript/lib/typescript.js:50023:30)
at serializeTypeNode (/Users/badim/github/orzo/orzo-frontend/node_modules/typescript/lib/typescript.js:49967:28)
at serializeUnionOrIntersectionType (/Users/badim/github/orzo/orzo-frontend/node_modules/typescript/lib/typescript.js:49989:44)
at serializeTypeNode (/Users/badim/github/orzo/orzo-frontend/node_modules/typescript/lib/typescript.js:49970:28)
at serializeReturnTypeOfNode (/Users/badim/git
@goloveychuk
goloveychuk / asd.swift
Created January 13, 2018 21:19
fix batterfly
import QuartzCore
let BLACK_LISTED: [Int64] = [8, 36]
var TIMEOUT = 100
struct State {
var lastTimestamp: CGEventTimestamp? = nil
@goloveychuk
goloveychuk / code.ll
Last active August 31, 2018 02:32
swift to wasm
; ModuleID = 'code.ll'
source_filename = "code.ll"
target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
target triple = "wasm32"
%swift.type = type { i64 }
%swift.type_metadata_record = type { i32, i32 }
%T4code5StrctV = type <{ %TSi, %TSi }>
%TSi = type <{ i64 }>
import * as ts from "typescript";
const path = require("path");
function rstrip(str: string, strip: string) {
let ind = str.lastIndexOf(strip);
if (ind === str.length - strip.length) {
return str.slice(0, str.length - strip.length);
}
return str;
}