Skip to content

Instantly share code, notes, and snippets.

@CodeDmitry
CodeDmitry / linux-config.txt
Last active March 28, 2021 19:30
fixing courier new on debianlikes
sudo apt-get install gnome-session-flashback
sudo apt update && sudo apt install ttf-mscorefonts-installer
to get courier new.
put into /etc/fonts/fonts.conf, google to check if there's an alternative location for fonts.conf or if you need
to make your own.
<match target="font">
<test name="family" qual="any">
@CodeDmitry
CodeDmitry / object_whose.js
Last active May 2, 2019 12:26
object_whose
(function() {
// | finds the owner of the specified property based on prototype chain.
function object_whose(propName) {
if (this.hasOwnProperty(propName)) return this;
var p = this.__proto__;
while (p) {
p = p.__proto__;
if (p.hasOwnProperty(propName)) {
return p;
@CodeDmitry
CodeDmitry / PowerShell-profile.ps1
Created June 13, 2018 14:39 — forked from PierreMage/PowerShell-profile.ps1
Make your Windows command line better with doskey
# http://technet.microsoft.com/en-us/library/ee692685.aspx
# F7 = history
# Alt+F7 = history -c
# F8 = Ctrl+R
Set-Location C:
# Easier navigation
Set-Alias o start
function oo {start .}
@CodeDmitry
CodeDmitry / glMatrix-0.9.5.js
Created September 21, 2017 03:33 — forked from rolandoam/glMatrix-0.9.5.js
glMatrix-0.9.5.js extern
/*
* Copyright 2011 Rolando Abarca.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@CodeDmitry
CodeDmitry / glMatrix-0.9.5.js
Created September 21, 2017 03:33 — forked from rolandoam/glMatrix-0.9.5.js
glMatrix-0.9.5.js extern
/*
* Copyright 2011 Rolando Abarca.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@CodeDmitry
CodeDmitry / state.hs
Created January 28, 2017 16:28 — forked from sdiehl/state.hs
State monad implementation + example
import Control.Monad
-------------------------------------------------------------------------------
-- State Monad Implementation
-------------------------------------------------------------------------------
newtype State s a = State { runState :: s -> (a,s) }
instance Monad (State s) where
return a = State $ \s -> (a, s)
@CodeDmitry
CodeDmitry / Lisp.pm
Created November 25, 2016 05:16 — forked from syohex/Lisp.pm
Lisp in 45 lines of Perl
package Lisp;
use strict;
use warnings;
use Scalar::Util qw/looks_like_number/;
use List::MoreUtils qw/zip/;
sub new {
my $env; $env = {
':label' => sub { my ($name, $val) = @_ ; $env->{$name} = $val;},
':quote' => sub { $_[0] },
@CodeDmitry
CodeDmitry / gist:c90dc81eb7ca43170201
Created January 30, 2016 23:25 — forked from abhinav1592/gist:4382110
A simple Notepad using Java. I have used swing and awt.
package notepad;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.Scanner;
import java.io.*;
public class Notepad extends JFrame implements ActionListener {
private TextArea textArea = new TextArea("", 0,0, TextArea.SCROLLBARS_VERTICAL_ONLY);