Skip to content

Instantly share code, notes, and snippets.


Pawel Kadluczka moozzyk

View GitHub Profile
View craigslist-puppeteer.ts
import * as puppeteer from "puppeteer";
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto(
waitUntil: "networkidle0",
moozzyk / rust
Last active December 31, 2018 05:48
View rust
Good documentation/starting guide
Should have read more before starting (e.g. the borrowing concept)
unwrap().unwrap().unwrap() everywhere (likely I am doing something wrong)
iter() vs into_iter() confusing for beginners
regex - quite easy to get it up and running
when is ';' (not) required?
lack of traditional `for` loop - counter needs to be in the loop
pattern matching
lifetimes/borrows are killing me - day 4 - could not return HashMap from a function
hint in errors are helpful:
let is_prime n =
let rec is_prime_aux n div =
if div > int_of_float (sqrt n) then true
else if n mod div = 0 then false
else is_prime_aux n (div + 1)
is_prime_aux n 2
(* Error: This expression has type float but an expression was expected of type
Points to `n` in `if n mod div...` *)
View How to use SignalR-Client-Swift
1. Install/Upgrade carthage package manager (e.g. using brew or pkg) - link to github repo
2. Create a new Cocoa/Swift app
3. Create a new file called `Cartfile` in the application folder
4. Add `github "moozzyk/SignalR-Client-Swift" master` to the file to get the latest version (releases, tags in the future)
5. Run `carthage update --platform macOS` (--platform can be skipped to install for iOS and tvOS)
6. Add SignalRClient and SockertRocket to "Embedded Binaries"
7. Add SignalRClient and SocketRocket to "Linked Frameworks and Libraries" (Note 6. should do this automatically)
8. Add `import SignalRClient` to import SignalR client definitions
9. When using http you will likely see this error:
SignalRApp[14409:1752344] App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.
View OCaml observations
~~ Verbose (vs mine) ~~
~~Inconsistencies (fold - accumulator first in List.fold_left but second in Hashtbl)
print_int (List.fold_left (fun acc line -> max acc (process line registers)) min_int lines);
print_endline "";
print_int (Hashtbl.fold (fun k v acc -> if v > acc then v else acc) registers min_int);~~
- lacking, samples very hard to find
- - initally confusing than helpful
~~Regular expressions - match groups~~
~~Basis IO operations - too complicated/missing~~
moozzyk / gist:5abdc2ff439c179832e143c6a72a3e0a
Last active April 9, 2018 23:44
SignalR Server tracing config
View gist:5abdc2ff439c179832e143c6a72a3e0a
[‎5/‎19/‎2017 12:05 PM]
Here is config the has all trace sources:
  <source name="SignalR.MessageBus">
          <add name="SignalR-Bus" />
View Debug ts tests
// Use IntelliSense to learn about possible Node.js debug attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit:
"version": "0.2.0",
"configurations": [
"type": "node",
"request": "launch",
"name": "Launch Program",
View gist:d7653d2348065b38be5f310f9f5cbe40
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM">
<ProjectConfiguration Include="Debug|Win32">
View gist:35bd9c532c0d1a7edd1f74cf219c88f7
"userSecretsId": "aspnet-WebApplication1-84f1878e-a871-4f80-baca-de15b99a96d9",
"dependencies": {
"RestSharp": "105.2.3",
"Microsoft.ApplicationInsights.AspNetCore": "1.0.0",
"Microsoft.AspNetCore.Authentication.Cookies": "1.0.0",
"Microsoft.AspNetCore.Diagnostics": "1.0.0",
"Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.0.0",
"Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0",