Skip to content

Instantly share code, notes, and snippets.

@kukuruza
kukuruza / gist_cifar10_train.py
Last active November 4, 2024 17:36
Tensorflow: visualize convolutional filters (conv1) in Cifar10 model
from math import sqrt
def put_kernels_on_grid (kernel, pad = 1):
'''Visualize conv. filters as an image (mostly for the 1st layer).
Arranges filters into a grid, with some paddings between adjacent filters.
Args:
kernel: tensor of shape [Y, X, NumChannels, NumKernels]
pad: number of black pixels around each filter (between them)
@benjaminjackman
benjaminjackman / README
Last active August 11, 2024 13:24
Instructions on how to open Unity3d scripts in Rider on Ubuntu
#Simple instructions for using Unity3d with project rider on Ubuntu
#1. Download and install latest .deb for Unity3d from:
http://forum.unity3d.com/threads/unity-on-linux-release-notes-and-known-issues.350256/
#2. Download and install the Project Rider EAP (not sure if publicly available but you
can sign up for early access here: https://www.jetbrains.com/rider/
#3. Open the Unity3d (.deb installs the executable at /opt/Unity/Editor/Unity )
@subfuzion
subfuzion / curl.md
Last active April 19, 2025 09:46
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@discorev
discorev / CBOW.ipynb
Created February 11, 2016 01:25
My implementation of CBOW in TensorFlow
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vasanthk
vasanthk / System Design.md
Last active April 21, 2025 02:58
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@djaiss
djaiss / gist:85a0ada83e6bca68e41e
Last active February 12, 2025 22:12
Block Twitter/Facebook in your /etc/hosts
# Block Facebook IPv4
127.0.0.1 www.facebook.com
127.0.0.1 facebook.com
127.0.0.1 login.facebook.com
127.0.0.1 www.login.facebook.com
127.0.0.1 fbcdn.net
127.0.0.1 www.fbcdn.net
127.0.0.1 fbcdn.com
127.0.0.1 www.fbcdn.com
127.0.0.1 static.ak.fbcdn.net
#!/bin/bash
set -e
# Change xxxxx sections to your personal AWS settings or set them to environment variables
export AWS_ACCESS_KEY_ID=xxxxxxx
export AWS_SECRET_ACCESS_KEY=xxxxxxx
export AWS_DEFAULT_REGION=xxxxxxx
# Get the subnet ID for the lowest availability zone in the VPC section of AWS console
export AWS_SUBNET_ID=xxxxxxx
package com.chamoapp.haegu;
...
public class CustomNumberPicker extends NumberPicker {
public CustomNumberPicker(Context context, AttributeSet attrs) {
super(context, attrs);
NumberPicker numberpicker = null;
@kennwhite
kennwhite / vpn_psk_bingo.md
Last active April 5, 2025 04:55
Most VPN Services are Terrible

Most VPN Services are Terrible

Short version: I strongly do not recommend using any of these providers. You are, of course, free to use whatever you like. My TL;DR advice: Roll your own and use Algo or Streisand. For messaging & voice, use Signal. For increased anonymity, use Tor for desktop (though recognize that doing so may actually put you at greater risk), and Onion Browser for mobile.

This mini-rant came on the heels of an interesting twitter discussion: https://twitter.com/kennwhite/status/591074055018582016

@j4nu5
j4nu5 / epi_10_12_2.cpp
Created February 22, 2015 09:39
Solution to EPI 10.12.2
#include <iostream>
#include <algorithm>
#include <vector>
#include <limits>
#include <cassert>
#include <limits>
using namespace std;
/******************** Solution Begin ***************************/