Skip to content

Instantly share code, notes, and snippets.

View ishanjain28's full-sized avatar
🎯
Focusing

Ishan Jain ishanjain28

🎯
Focusing
View GitHub Profile
@stevedonovan
stevedonovan / shared.rs
Created April 14, 2017 13:49
An ergonomic way of saying Rc<RefCell>
use std::rc::Rc;
use std::cell::{RefCell,Ref, RefMut};
use std::ops::Deref;
use std::fmt;
#[derive(Clone)]
struct Shared<T> {
v: Rc<RefCell<T>>
}
@Brainiarc7
Brainiarc7 / refind-setup.md
Last active March 15, 2024 17:53
Setting up rEFInd on Ubuntu 16.04 LTS for multi-boot purposes with secure boot enabled.

Deploying rEFInd on Ubuntu 16.04 LTS with secure boot enabled

Hello guys,

For these dual-booting Ubuntu 16.04 with an alternate operating system in UEFI boot mode, it may often be necessary to use a third-party boot manager such as rEFInd, as it's significantly superior to grub2's on UEFI-capable systems.

This write-up assumes that:

(a). The user is running a current Ubuntu 16.04LTS operating system installation (preferably on a dual-boot system)

@Reedbeta
Reedbeta / cool-game-programming-blogs.opml
Last active December 29, 2023 10:02
List of cool blogs on game programming, graphics, theoretical physics, and other random stuff
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>Graphics, Games, Programming, and Physics Blogs</title>
</head>
<body>
<outline text="Tech News" title="Tech News">
<outline type="rss" text="Ars Technica" title="Ars Technica" xmlUrl="http://feeds.arstechnica.com/arstechnica/index/" htmlUrl="https://arstechnica.com"/>
<outline type="rss" text="Polygon - Full" title="Polygon - Full" xmlUrl="http://www.polygon.com/rss/index.xml" htmlUrl="https://www.polygon.com/"/>
<outline type="rss" text="Road to VR" title="Road to VR" xmlUrl="http://www.roadtovr.com/feed" htmlUrl="https://www.roadtovr.com"/>

Experimental Docker Libnetwork DHCP Driver

The DHCP driver is intended for users to be able to integrate Docker IP address management with their existing IPAM strategies that use DHCP for dynamic address assignment. DHCP enables users to allocate addresses in an organized fashion that will prevent overlapping IP address assignment by associating a unique MAC address from the container eth0 Ethernet interface to an IP address as determined by the DHCP pools defined in the DHCP configuration.

This driver only provides the DHCP client functionality. It does not include a DHCP server. The default driver offers single-host IPAM or for distributed multi-host orchestrated IPAM see the libnetwork overlay driver.

Getting Started

@mxstbr
mxstbr / idea.md
Last active February 16, 2021 18:33
Code splitting react-router routes with webpack 2

NOTE: Sokra confirmed I had a misunderstanding, Webpack is still a static build tool and the below won't work. It's still a nice concept though...

With webpack 1, code splitting react-router routes is quite tedious. It requires us to repeat the getComponent function over and over again. (See here for an explanation how it works with webpack 1)

Example:

<Router history={history}>
  <Route
    path="/"
@natefoo
natefoo / 00README.md
Last active April 15, 2024 11:48
Linux Distribution Detection

Distribution Detection

I am working on adding support for building and distributing (via PyPI) Python Wheels with C Extensions to the Python wheel and pip packages. The discussion on Distutils-SIG continues, but I believe it is fairly certain that some effort to correctly identify Linux distributions will need to be made. I've begun efforts to add this support to wheel.

How you can help

If you have a Linux distribution or version of a listed distribution not in this gist, or one of the ones I have not directly verified, I could use the following:

  • The contents of /etc/os-release, if it exists
@ldong
ldong / download_egghead_videos.md
Last active December 7, 2023 16:16
download egghead videos

Download videos from egghead

Go to the egghead website, i.e. Building a React.js App

run

$.each($('h4 a'), function(index, video){
  console.log(video.href);
});
@protrolium
protrolium / ffmpeg.md
Last active April 8, 2024 11:49
ffmpeg guide

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

You can get the list of installed codecs with:

@forrestbthomas
forrestbthomas / gist:b011842bc77e2812408b
Created May 25, 2015 19:50
Single-byte XOR cipher
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int most_freq_chars(char *decrypt_attempt)
{
struct high_freq_characters {
int E;
int T;