Skip to content

Instantly share code, notes, and snippets.

View therustmonk's full-sized avatar
🦀
thread 'main' panicked at 'not yet implemented', src/main.rs:2:5

Denis Kolodin therustmonk

🦀
thread 'main' panicked at 'not yet implemented', src/main.rs:2:5
View GitHub Profile
@bokner
bokner / digest_auth.erl
Created April 10, 2010 16:26
Erlang module implementing HTTP digest auth on client side
%% Author: bokner
%% Created: Apr 10, 2010
%% Description: HTTP digest authentication
%% Note: the code follows the informal explanation given on Wikipedia.
%% Note: the test/0 function doesn't intend to send a proper data to webdav service,
%% it just shows how to pass the authorization.
%% Disclaimer: Use on your own risk. The author disclaims any liability
%% with regard to using this code.
-module(digest_auth).
@yenliangl
yenliangl / gist:559257
Created August 31, 2010 16:00
Use jdb to debug Android application
# Use jdb to debug Android application
# Run ddms and select application to forward port.
ddms
# Execute jdb and attach to the listening application
jdb -attach localhost:8700
# Or in windows, need to specify connector explicitly
jdb -connect com.sun.jdi.SocketAttach:hostname=localhost,port=8700
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 7, 2024 10:50
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@mausch
mausch / gist:3188428
Created July 27, 2012 14:43
Async exception handling in F#
open System
open System.Net
// exception handling in async using Async.Catch
let fetchAsync (name, url:string) =
async {
let uri = new System.Uri(url)
let webClient = new WebClient()
let! html = Async.Catch (webClient.AsyncDownloadString(uri))
match html with
@jxnblk
jxnblk / .htaccess
Last active March 12, 2023 12:25
.htaccess for using AngularJS's in HTML5 mode on Media Temple
Options +FollowSymLinks
<ifModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !index
RewriteRule (.*) index.html [L]
</ifModule>
@msama
msama / CheckableLinearLayout.java
Last active June 23, 2016 11:59
A checkable Android LinearLayout. This is useful for custom list rows.
package com.ahuralab.shakeacocktail.layouts;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.Checkable;
import android.widget.LinearLayout;
/**
* Allow custom list rows to be checked.
*
@kerimdzhanov
kerimdzhanov / random.js
Last active June 2, 2024 00:43
JavaScript: get a random number from a specific range
/**
* Get a random floating point number between `min` and `max`.
*
* @param {number} min - min number
* @param {number} max - max number
* @return {number} a random floating point number
*/
function getRandomFloat(min, max) {
return Math.random() * (max - min) + min;
}

NOTE: This was first authored on 26 Feb 2014. Things may have changed since then.

C++'s Templates

C++'s templates could be seen as forming a duck typed, purely functional code generation program that is run at compile time. Types are not checked at the initial invocation stage, rather the template continues to expand until it is either successful, or runs into an operation that is not supported by that specific type – in that case the compiler spits out a 'stack trace' of the state of the template expansion.

To see this in action, lets look at a very simple example:

template 
@finalfantasia
finalfantasia / fixing_text_anti_aliasing_in_fedora.md
Last active March 20, 2024 22:53
Fixing Text Anti-aliasing in Fedora
  1. Add the RPMFusion repositories (both free and non-free) to the YUM repository directory (/etc/yum.repos.d/):
sudo dnf localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
  1. Install the patched version of FreeType with subpixel rendering enabled:
sudo dnf install -y freetype-freeworld