Skip to content

Instantly share code, notes, and snippets.

View kamalx's full-sized avatar

Kamal Morjal kamalx

  • India
View GitHub Profile
@valosekj
valosekj / string_manipulation.md
Last active May 2, 2024 06:50
Useful string manipulation examples for bash and zsh #blog

Useful string manipulation examples for bash and zsh

I need very often to modify filenames or replace/delete their parts across huge number of files. I was using sed command for these purposes but recently I have found out that all these tasks can be easily done directly in bash (or zsh) because both of them support so called string manipulation operations.

String manipulations

Define some example string:

$ file=some_file_name.txt
@fnky
fnky / ANSI.md
Last active July 23, 2024 14:55
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@victoriadrake
victoriadrake / lambda-rss-tweeter.go
Last active April 7, 2020 04:11
Tweet RSS feed links for AWS Lambda
package main
import (
"math/rand"
"net/url"
"os"
"time"
"github.com/ChimeraCoder/anaconda"
"github.com/Sirupsen/logrus"
@diaz-de-berenguer
diaz-de-berenguer / app.js
Created February 5, 2018 19:00
Removing a User from an array
// Define WebSocket using ws library
const WebSocket = require('ws');
// Initialise wss as a new Websocket Server running in port 8989
const wss = new WebSocket.Server({ port: 8989 });
// Array of users currently logged in. Serves as the Database.
var users = [];
// This is the code that will run on the server when a new client is connected to
@p3t3r67x0
p3t3r67x0 / prefixed-properties.md
Last active October 31, 2020 15:16
Be aware that every rendering engine has its own implementation of prefixed properties. As extensions are made part of the standard, the unprefixed identifier is then substituted.

Prefixed style properties

-ms-accelerator

The -ms-accelerator property sets or retrieves a string that indicates whether the object represents a keyboard shortcut.

-ms-accelerator: false | true
@p3t3r67x0
p3t3r67x0 / pseudo_elements.md
Last active January 16, 2024 01:17
A CSS pseudo-element is used to style specified parts of an element. In some cases you can style native HTML controls with vendor specific pseudo-elements. Here you will find an list of cross browser specific pseudo-element selectors.

Styling native elements

Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element or the /deep/ path selector.

video::webkit-media-controls-timeline {
  background-color: lime;
}

video /deep/ input[type=range] {

Cactus Blog Plugin

Setup

Enable the blog plugin by renaming blog.disabled.py to blog.py in your site's plugins directory.

Create a directory called posts in your site's pages directory.

Basic usage

@kevin-smets
kevin-smets / iterm2-solarized.md
Last active July 23, 2024 04:22
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@EmranAhmed
EmranAhmed / 1. main.css
Last active January 11, 2024 01:29
CSS Responsive breakpoint, Media Query break point
/*==================================================
= Bootstrap 3 Media Queries =
==================================================*/
/*========== Mobile First Method ==========*/
/* Custom, iPhone Retina */
@media only screen and (min-width : 320px) {
}
from django import http
from django.conf import settings
"""
Put this file in a directory called, eg, 'middleware,' inside your django
project. Make sure to create an __init__.py file in the directory so it can
be included as a module.
Set the values for
XS_SHARING_ALLOWED_ORIGINS
XS_SHARING_ALLOWED_METHODS