Skip to content

Instantly share code, notes, and snippets.

View 46bit's full-sized avatar
🏳️‍🌈

Miki Mokrysz 46bit

🏳️‍🌈
View GitHub Profile
@Sgeo
Sgeo / gadts.rs
Last active July 14, 2023 12:14 — forked from mstewartgallus/gadts.rs
Gadts in Rust
/// This type is only every inhabited when S is nominally equivalent to T
#[derive(Debug)]
pub struct Is<S, T>(::std::marker::PhantomData<(*const S, *const T)>);
// Construct a proof of the fact that a type is nominally equivalent
// to itself.
pub fn is<T>() -> Is<T, T> { Is(::std::marker::PhantomData) }
// std::mem::transmute does not accept unsubstituted type parameters
// manual transmute as suggested by manual
@munificent
munificent / gist:9749671
Last active June 23, 2022 04:04
You appear to be creating a new IDE...
You appear to be advocating a new:
[ ] cloud-hosted [ ] locally installable [ ] web-based [ ] browser-based [ ] language-agnostic
[ ] language-specific IDE. Your IDE will not succeed. Here is why it will not succeed.
You appear to believe that:
[ ] Syntax highlighting is what makes programming difficult
[ ] Garbage collection is free
[ ] Computers have infinite memory
[ ] Nobody really needs:
@drahamim
drahamim / questions.txt
Created October 13, 2021 20:24
Job Questions for recruiters
Hi {{ Recruiter_first_name }},
Thanks for reaching out. Before we jump on a call, can you answer a few questions for me.
1. What is the current on-call like for the team?
2. How much on-call is expected for this role?
3. Expected Base comp range?
4. What are the expected {{ your_tz }} work hours?
5. How big is the team?
Please also send over a FULL job description.
Thanks in advance,
{{ Your First name here }}
@silvadanilo
silvadanilo / infinite-reconnect.rs
Last active May 16, 2019 09:03
Asynchronously reconnecting a client to a server in an infinite loop
extern crate futures;
extern crate tokio_core;
extern crate tokio_line;
use futures::future::{self, Future, Loop};
use futures::{Stream};
use std::{io, str};
use tokio_core::io::{Io};
use tokio_core::net::{TcpStream};
use tokio_core::reactor::{Core, Handle};
@ShivamMistry
ShivamMistry / nas-wired
Last active September 2, 2018 20:28
Wired NAS netctl config and wpa_supplicant config for University of York
Description='NAS York'
Interface=enp3s0
Connection=ethernet
IP=dhcp
Auth8021X=yes
Priority=2
WPAConfigFile=/etc/wpa_supplicant/nas.conf
@rsutphin
rsutphin / tag_and_push_tag.cap
Last active April 18, 2018 13:08
A capistrano 3 task to tag the repo after every deploy
# Requires Capistrano 3.2 or later
namespace :deploy do
after :finishing, :tag_and_push_tag do
on roles(:app) do
within release_path do
set(:current_revision, capture(:cat, 'REVISION'))
# release path may be resolved already or not
resolved_release_path = capture(:pwd, "-P")
@philandstuff
philandstuff / devopsdays.org
Last active October 12, 2017 21:05
Devopsdays london 2017

Devopsdays London 2017

initial session, bob walker (@rjw1)

  • welcome everyone!
  • we have a code of conduct
  • thanks to organisers, sponsors, etc

Humane Teams at home and around the world

@g3d
g3d / netsed.rb
Created November 18, 2012 10:20
Netsed homebrew formula
require 'formula'
class Netsed <Formula
url 'http://silicone.homelinux.org/release/netsed/netsed-1.1.tar.gz'
homepage 'http://www.securiteam.com/tools/5IP022A35W.html'
version '1.1'
md5 'df64a6099370013621489c60fe97a324'
def install
system "make"
extern crate futures;
use std::sync::atomic::{AtomicBool, Ordering};
use std::thread;
use std::sync::Arc;
use std::time::{Instant, Duration};
use futures::{Async, Future};
use futures::executor::{self, Spawn};
use futures::task::Unpark;
@chrishanretty
chrishanretty / conswing.R
Last active April 24, 2017 20:45
Analysis of swings in Conservative and Labour-held seats, BES data
library(foreign) ## for data import
library(dplyr) ## for chaining ops together
library(ggplot2) ## for plotting
library(reshape2) ## for reshaping
library(hrbrthemes) ## for pretty pictures
library(survey) ## for... uh, survey data
party.colours <- c("#0087DC","#D50000","#FDBB30","#FFFF00","#008142","#99CC33","#70147A","#DDDDDD")
bes <- read.spss("~/Dropbox/2017-forecasting/data/individual/BES2015_W10_Panel_v0.3.sav")