Skip to content

Instantly share code, notes, and snippets.

View emamulandalib's full-sized avatar

Emamul Andalib emamulandalib

View GitHub Profile
@emamulandalib
emamulandalib / sources.list
Last active June 27, 2020 05:15
Speed up Ubuntu "apt update", "apt upgrade", "apt dist-upgrade" by using mirror method. This will select the nearest Ubuntu mirror server. Update /etc/apt/sources.list. Just replace the release name with your release name. Like `20.04 = focal`. I have used `focal` here. To know the release name visit the link: https://en.wikipedia.org/wiki/Ubunt…
# Just replace the release name with your release name. Like `20.04 = focal`. I have used `focal` here.
# To know the release name visit the link: https://en.wikipedia.org/wiki/Ubuntu_version_history
deb mirror://mirrors.ubuntu.com/mirrors.txt focal main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt focal-updates main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt focal-backports main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt focal-security main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ focal-security main restricted
deb http://security.ubuntu.com/ubuntu/ focal-security universe
backend httpbin
balance roundrobin
mode http
server master 192.168.50.10:32009 check check-sni httpbin.example.com sni str(httpbin.example.com) ssl verify none
http-request set-header Host httpbin.example.com
http-request set-header X-Forwarded-For %[src]
http-request set-header X-Forwarded-Port %[dst_port]
http-request add-header X-Forwarded-Proto https if { ssl_fc }
slackResponse = null
pipeline {
agent any
environment {
GIT_COMMIT_MESSAGE = """${sh(
returnStdout: true,
script: "git --no-pager show -s --format='%s' ${GIT_COMMIT}"
)}"""
@emamulandalib
emamulandalib / name_conventions_dictionaries.py
Created December 18, 2018 12:26 — forked from jllopezpino/name_conventions_dictionaries.py
Replace keys in underscore lowercase convention for camel case convention and vice versa.
def camel_to_underscore(name):
"""
Convert a name from camel case convention to underscore lower case convention.
Args:
name (str): name in camel case convention.
Returns:
name in underscore lowercase convention.
"""
camel_pat = compile(r'([A-Z])')
@emamulandalib
emamulandalib / Redux-Form-Semantic-UI-React
Created January 19, 2018 19:23 — forked from mairh/Redux-Form-Semantic-UI-React
Semantic-UI-React form validation using redux-form example
// semantic-ui-form.js
import React from 'react';
import PropTypes from 'prop-types';
import { Form, Input } from 'semantic-ui-react';
export default function semanticFormField ({ input, type, label, placeholder, meta: { touched, error, warning }, as: As = Input, ...props }) {
function handleChange (e, { value }) {
return input.onChange(value);
}