Skip to content

Instantly share code, notes, and snippets.

@alashow
alashow / user.js
Last active March 19, 2018 01:50
Force tumblr posts use hight quality images. Tempermonkey user script.
// ==UserScript==
// @name Tumblr image size converter
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Force tumblr post photos use high quality
// @author Alashov Berkeli
// @include https://www.tumblr.com/*
// @require https://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js
// @grant none
// ==/UserScript==
@gka
gka / make-animated-gifs-using-ffmpeg.md
Last active June 23, 2025 23:20
how to make a nice GIF from png frames

Make sure ffmpeg is up-to-date:

brew update
brew upgrade ffmpeg

Convert a MOV into frames. Tweak the 2/1 if you want more or fewer frames.

@ipbastola
ipbastola / clean-up-boot-partition-ubuntu.md
Last active August 16, 2024 13:39
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@wngreene
wngreene / udacity_cs344_hw2_kernel.cu
Created June 8, 2016 23:43
Udacity CS344 HW2 Kernel
// Homework 2
// Image Blurring
//
// In this homework we are blurring an image. To do this, imagine that we have
// a square array of weight values. For each pixel in the image, imagine that we
// overlay this square array of weights on top of the image such that the center
// of the weight array is aligned with the current pixel. To compute a blurred
// pixel value, we multiply each pair of numbers that line up. In other words, we
// multiply each weight with the pixel underneath it. Finally, we add up all of the
// multiplied numbers and assign that value to our output for the current pixel.
@application2000
application2000 / how-to-install-latest-gcc-on-ubuntu-lts.txt
Last active June 8, 2025 17:38
How to install latest gcc on Ubuntu LTS (12.04, 14.04, 16.04)
These commands are based on a askubuntu answer http://askubuntu.com/a/581497
To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below.
USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING.
ABSOLUTELY NO WARRANTY.
If you are still reading let's carry on with the code.
sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
@zeux
zeux / nlerpsimd.cpp
Created May 6, 2016 03:40
A very fast version of nlerp with precision tweaks to make it match slerp, with SSE2 and AVX2 optimizations.
#include <stdio.h>
#include <math.h>
#include <immintrin.h>
#include <vector>
#include <type_traits>
#ifdef IACA
#include <iacaMarks.h>
#else
@decrispell
decrispell / make_vtk_camera.cpp
Last active March 1, 2024 02:47
Convert standard camera intrinsic (focal length, principal point) and extrinsic parameters (rotation and translation) into a vtkCamera for rendering. Assume square pixels and 0 skew for now.
/**
* Convert standard camera intrinsic and extrinsic parameters to a vtkCamera instance for rendering
* Assume square pixels and 0 skew (for now).
*
* focal_len : camera focal length (units pixels)
* nx,ny : image dimensions in pixels
* principal_pt: camera principal point,
* i.e. the intersection of the principal ray with the image plane (units pixels)
* camera_rot, camera_trans : rotation, translation matrix mapping world points to camera coordinates
* depth_min, depth_max : needed to set the clipping range
@autosquid
autosquid / opencvyaml1-1.py
Last active September 26, 2022 08:08
pyyaml loading opencv yaml
# construct node
def opencv_matrix(loader, node):
mapping = loader.construct_mapping(node, deep=True)
mat = np.array(mapping["data"])
mat.resize(mapping["rows"], mapping["cols"])
return mat
yaml.add_constructor(u"tag:yaml.org,2002:opencv-matrix", opencv_matrix)
# loading
@bartvm
bartvm / dl-frameworks.rst
Last active December 7, 2020 18:18
A comparison of deep learning frameworks

A comparison of Theano with other deep learning frameworks, highlighting a series of low-level design choices in no particular order.

Overview

Symbolic: Theano, CGT; Automatic: Torch, MXNet

Symbolic and automatic differentiation are often confused or used interchangeably, although their implementations are significantly different.