Skip to content

Instantly share code, notes, and snippets.

View ezze's full-sized avatar
💭
Back to the heavyweight jam

Dmitriy Pushkov ezze

💭
Back to the heavyweight jam
View GitHub Profile
@muhammadghazali
muhammadghazali / What is server_names_hash_bucket_size.md
Last active February 9, 2024 14:13
Nginx: What is server_names_hash_bucket_size?

Background

While I'm learning how to use Nginx, I was instructed to update the server_names_hash_bucket_size (/etc/nginx/nginx.conf) value from 32 to 64, but I don't understand why should I increase the value to 64.

References

References that have been read so far:

@sanikkenway
sanikkenway / job.rb
Last active February 3, 2019 12:12
if dev.is_bored? || job.sucks?
Job::search(:flexible_hours true, :company_culture 100)
end
@guseppiguliano
guseppiguliano / huawei_e8372_config.md
Last active February 13, 2024 11:55
Huawei E8372 Linux Configuration and Setup

Dependencies

  1. usb_modeswitch, usb_modeswitch-data
  2. libusb1
  3. libusb-devel(Fedora), libusb-dev(Debian based)

Configuration

By default, your linux box would register your Huawei E8372 as a Mass Storage device and not (somehow) as a modem. First, make sure you have the exace same device we're talking about. This can be confirmed by looking at two values using the following command (while the dongle is plugged in): As an elevated user:

    # lsusb | grep Huawei
@remarkablemark
remarkablemark / Dockerfile
Last active April 24, 2024 13:40
Install node and npm with nvm using Docker.
# set the base image to Debian
# https://hub.docker.com/_/debian/
FROM debian:latest
# replace shell with bash so we can source files
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
# update the repository sources list
# and install dependencies
RUN apt-get update \
@mrmlnc
mrmlnc / electron-api.md
Last active August 25, 2023 07:23
Electron API

Базовые возможности

process — это объект, позволяющий получить информацию о типе запущенного процесса (рендеринг или основной процесс), версию Chrome и Electron, а также путь до выполняемого js-файла.

Пользовательские элементы DOM:

Объект File — это абстракция над нативным File, передающая стандартному HTML5 file API путь к физическому расположению файла в файловой системе пользователя.

@SkaveRat
SkaveRat / gist:9fce0c63458c369a9095
Created July 11, 2015 17:51
Generating matrix.org synapse self signed certificate
# Set your domain here
MXDOMAIN=m.example.com
# This script will ask you for a password. This is for your CA key and you need it in the next step, when signing your application certificate with your CA key. You can remove the "-aes256" flag in the first line to create a passwordless key, but it is not advised in production.
# Let this script run, and move the generated *.tls.* files into your synapse home directory and restart synapse.
# For android to recognize this, you need to copy the "ca.crt.pem" file to your phone and go to: "Settings->Security->import from SD card" and select the pem-file.
# This certificate has a "CA-Flag" set to true, otherwise android would not import this file correctly.
openssl genrsa -aes256 -out ca.key.pem 4096
@mattmccray
mattmccray / component-with-mixins.js
Created February 17, 2015 19:42
ES6 Classes w/Mixins -- Idea -- React 0.13
export function ComponentWithMixins( ...mixins) {
class MixedComponent extends React.Component { }
for( let mixin of mixins) {
// TODO: Would need to handle mixin collisions...
for( let name of Object.keys( mixin)) {
MixedComponent.prototype[ name]= mixin[ name]
}
}
@DavidWells
DavidWells / reset.css
Last active May 4, 2024 20:04 — forked from karbassi/reset.css
CSS reset. Follow me on the twitters for more tips: https://twitter.com/davidwells
/* http://meyerweb.com/eric/tools/css/reset/
v2.0-modified | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,

Screencapture and animated gifs

I say "animated gif" but in reality I think it's irresponsible to be serving "real" GIF files to people now. You should be serving gfy's, gifv's, webm, mp4s, whatever. They're a fraction of the filesize making it easier for you to deliver high fidelity, full color animation very quickly, especially on bad mobile connections. (But I suppose if you're just doing this for small audiences (like bug reporting), then LICEcap is a good solution).

Capturing (Easy)

  1. Launch quicktime player
  2. do Screen recording

screen shot 2014-10-22 at 11 16 23 am

@mmasashi
mmasashi / .sshrc
Created December 5, 2013 22:45
How to "ssh-add" without entering passphrase.
# ssh-settings
eval $(ssh-agent)
priv_path="$HOME/.ssh/ida_rsa"
passphrase="aaaa"
if [ "$passphrase" = "" ]; then
# without passphrase
ssh-add $priv_path
else