Skip to content

Instantly share code, notes, and snippets.

View halfzebra's full-sized avatar

Eduard Kyvenko halfzebra

View GitHub Profile
# -*- coding: utf-8 -*-
# IT'S PYTHON2.7
# Check which pip version do you have: pip --version
# Then you need to install
# pip install requests
# -*- coding: utf-8 -*-
import time
import sys
import requests
import itertools
@kdrakon
kdrakon / Rusts_Bindgen_+_Fuse_in_2019.md
Last active July 29, 2021 21:38
Demonstrates how I got bindgen to generate the bindings to libfuse

Rust's Bindgen + Fuse in 2019

I will quickly show how I got bindgen (https://rust-lang.github.io/rust-bindgen) to generate the bindings to Fuse (libfuse) with the current stable release of Rust. By doing so, this should demonstrate how to bootstrap writing your own Fuse file system in Rust.

I do realise that there are some crates that already exist that aid in making Fuse drivers in Rust, but this was more or less an excuse to also try out bindgen, which I don't believe those existing libraries utilise.

I will be using:

@halfzebra
halfzebra / index.js
Last active December 28, 2018 12:12
State Machine with Async Transitions
// Async Generator for implementing State Machines with asynchronous transitions.
//
// Try online: https://jsfiddle.net/ecf1bho9/
console.clear()
async function* state() {
let state = 0
let action
while (true) {
@jmlsf
jmlsf / js-in-cljs.md
Last active January 25, 2024 23:15
Using JavaScript modules in ClojureScript

Using JavaScript Libraries from ClojureScript

Using JavaScript libraries from ClojureScript involves two distinct concerns:

  1. Packaging the code and delivering it to the browser
  2. Making ClojureScript code that accesses JavaScript libraries safe for advanced optimization

Right now, the only single tool that solves these probems reliably, optimally, and with minimal configuration is shadow-cljs, and so that is what I favor. In paricular, shadow-cljs lets you install npm modules using npm or yarn and uses the resulting package.json to bundle external dependencies. Below I describe why, what alternatives there are, and what solutions I disfavor at this time.

Packaging and Delivering Code

@dentechy
dentechy / WSL-ssh-server.md
Last active March 30, 2024 16:16
A step by step tutorial on how to automatically start ssh server on boot on the Windows Subsystem for Linux

How to automatically start ssh server on boot on Windows Subsystem for Linux

Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running through a technology called the Windows Subsystem for Linux. Below are instructions on how to set up the ssh server to run automatically at boot.

  1. Edit the /etc/ssh/sshd_config file by running the command sudo vi /etc/ssh/sshd_config and do the following
    1. Change Port to 2222 (or any other port above 1000)
    2. Change PasswordAuthentication to yes. This can be changed back to no if ssh keys are setup.
  2. Restart the ssh server:
    • sudo service ssh --full-restart
  3. With this setup, the ssh server must be turned on every time you run Bash on Ubuntu on Windows, as by default it is off. Use this command to turn it on:
// install @types/react-redux and other nonsense
import * as React from 'react'
import { connect } from 'react-redux'
import { YourActualAppState } from './wherever-it-is.ts'
export function mapStateToProps({
whatever
}: YourActualAppState) {
return {
@kitten
kitten / reactiveconf-sc-cfp.md
Last active November 17, 2020 15:06
ReactiveConf 2017 Lightning Talk CFP: With styled-components into the future

styled-components Logo

With styled-components into the future

Preprocessing is dead, long live preprocessing!


This is a CFP for ReactiveConf 2017's open call for Lightning talks. If you'd like to see this talk become a reality, please ⭐ star this gist. #ReactiveConf

@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active May 3, 2024 11:35
Hyperlinks in Terminal Emulators
@jevakallio
jevakallio / reactiveconf-slam-poetry.md
Last active July 7, 2021 19:57
#ReactiveConf 2017 Lightning Talk Submission: JavaScript Slam Poetry

TL;DR: If you want to see me perform a spoken word poem about JavaScript in front of 1000 people (and on video), please ⭐ star this gist. If you're on mobile, you'll need to request desktop site.

JavaScript Slam Poetry

Javascript! Slam! Poetry!

@Birdie0
Birdie0 / ifttt-webhooks-extended-guide.md
Last active March 6, 2024 13:38
How to use Discord Webhooks

⚠️ This gist is no longer updated! For maintained, improved and even more extended guide click here.


How to use Discord Webhook

It's a JSON

First, learn JSON. It's not programming language, not even close. Just follow syntax rules and you will be fine.