Skip to content

Instantly share code, notes, and snippets.

@m5lil
m5lil / reset.sh
Last active April 27, 2024 12:54
[reset jetbrains application trial] reset jetbrains ide evals v1.0.4 #others
#!/bin/bash
# reset jetbrains ide evals v1.0.4
OS_NAME=$(uname -s)
JB_PRODUCTS="IntelliJIdea CLion PhpStorm GoLand PyCharm WebStorm Rider DataGrip RubyMine AppCode"
if [ "$OS_NAME" == "Darwin" ]; then
echo 'macOS:'
for PRD in $JB_PRODUCTS; do
@Gavinok
Gavinok / productive.org
Created April 26, 2024 03:39
Show notes from my Double Your Productivity With Emacs Org-mode video

Double Your Productivity With Org Mode

What is productivity?

Using the oxford dictionary

Productivity
the rate at which a worker, a company or a country produces goods, and the amount produced, compared with how much time, work and money is needed to produce them
@JonCole
JonCole / Redis-BestPractices-General.md
Last active April 27, 2024 12:50
Redis Best Practices

Some of the Redis best practices content has moved

This content from this markdown file has moved a new, happier home where it can serve more people. Please check it out : https://docs.microsoft.com/azure/azure-cache-for-redis/cache-best-practices.

NOTE: Client specific guidance listed below is still valid and should still be considered. I will update this document once all content has been moved.

@x3rAx
x3rAx / # SSH-Agent.md
Last active April 27, 2024 12:47
SSH Agent

Note:

Replace @ with / in filenames.

Set up your .bashrc to use .shellrc.d.

Make sure ssh-agent, ps and awk are installed and that $USER is set to your username.

@x3rAx
x3rAx / # Shellrc.d #.md
Last active April 27, 2024 12:47
Setup instructions for `~/.shellrc.d/`

Shellrc.d

Setup

Create the directory ~/.shellrc.d

mkdir ~/.shellrc.d

@ofou
ofou / servers.csv
Created April 11, 2021 06:15
List of servers to test speedtest-cli
We can't make this file beautiful and searchable because it's too large.
Country,City,Provider,Host,ID
Abkhazia,Sukhum,Aquafon GSM,62.182.8.78:8080,9058
Abkhazia,Sukhum,"Systema, LTD",cyxym.net:8080,5089
Abkhaziya,Sukhum,A-Mobile,speedtest.a-mobile.biz:8080,9714
Afghanistan,Herat,Afghan Wireless,hrtspeedtest.afghan-wireless.com:8080,9622
Afghanistan,Kabul,Afghan Telecom,sp1.afghantelecom.af:8080,11019
Afghanistan,Kabul,etisalat Afghanistan,speedtest.etisalat.af:8080,21807
Afghanistan,Kabul,Afghan Wireless,speedtest.afghan-wireless.com:8080,5189
Afghanistan,Kabul,Afghan Wireless Communication Company,kdzspeedtest.afghan-wireless.com:8080,13501
Afghanistan,Kabul,Insta Telecom,speedtest.instatelecom.com:8080,12798
@mattysmith22
mattysmith22 / Dfa.hs
Created July 18, 2020 16:24
Deterministic Finite Automaton implementation in Haskell
module Dfa (DFA, State, transition, runString, match, findEquivalent, nequivalent, automaton1, automaton2, minimise) where
import Data.List
import Text.Layout.Table
type State = Int
data DFA = DFA
{ states :: [State]
, initial :: State
, final :: [State]
@xameeramir
xameeramir / default nginx configuration file
Last active April 27, 2024 12:35
The default nginx configuration file inside /etc/nginx/sites-available/default
# Author: Zameer Ansari
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
@davidhq
davidhq / gist:3556485
Created August 31, 2012 17:51
Unpermute (reverse Burrows-Wheeler transform)
# calculates BW(T)
def bw(t):
m = sorted(t[-i:] + t[:-i] for i in range(len(t)))
return "".join(m[i][len(t)-1] for i in range(len(t)))
# for a given string return index with nth occurence of char
def n_occurence_index(string, char, n):
vector = [string[:index+1].count(char) for index in range(0, len(string))]
return vector.index(n)
@cpq
cpq / Stack.md
Last active April 27, 2024 12:27
Why stack grows down

Why stack grows down

Any running process has several memory regions: code, read-only data, read-write data, et cetera. Some regions, such as code and read-only data, are static and do not change over time. Other regions are dynamic: they can expand and shrink. Usually there are two such regions: dynamic read-write data region, called heap, and a region called stack. Heap holds dynamic memory allocations, and stack is mostly used for keeping function frames.

Both stack and heap can grow. An OS doesn't know in advance whether stack or heap will be used predominantly. Therefore, an OS must layout these two memory regions in a way to guarantee maximum space for both. And here is the solution:

  1. Layout static memory regions at the edges of process's virtual memory
  2. Put heap and stack on edges too, and let them grow towards each other: one grows up, one grows down