Skip to content

Instantly share code, notes, and snippets.

@CaddyDz
CaddyDz / shader.glsl
Created December 23, 2019 13:44
Universe OpenGL shader script
#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif
uniform vec2 resolution;
uniform float time;
uniform float subsecond;
@CaddyDz
CaddyDz / search.html
Last active November 6, 2021 11:26
Algolia simple instant search with vanilla JS
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Instant Search JS</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/instantsearch.js@2.1.1/dist/instantsearch.min.css">
<style>

unclear what you're asking

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.

off-topic

Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Reproducible Example.

Too Broad

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question.

@CaddyDz
CaddyDz / git_prompt_info.zsh
Created December 19, 2017 18:19 — forked from msabramo/git_prompt_info.zsh
The slowness of my zsh prompt when in a git-svn managed directory was killing me. I improved it by removing the git status stuff that slows it down...
function git_prompt_info() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$ZSH_THEME_GIT_PROMPT_SUFFIX"
}
@CaddyDz
CaddyDz / regex.md
Created October 13, 2017 15:00
Algerian phone number regular expression

Regular Expression for Algerian Mobile Phone Numbers

Mobile number format

 ^(00213|\+213|0)(5|6|7)[0-9]{8}$

Legit mobile only

 ^(0)(5|6|7)(4|5|6|7)[0-9]{7}$

Javascript Example

@CaddyDz
CaddyDz / shortcut.py
Created April 12, 2017 16:17
Get the target of a shortcut on Windows desktop
import os
from win32com.shell import shell
import pythoncom
# Create an instance of the shell
zsh = pythoncom.CoCreateInstance(shell.CLSID_ShellLink, None, pythoncom.CLSCTX_INPROC_SERVER, shell.IID_IShellLink)
# Query an interface of the persistent file
persist = zsh.QueryInterface(pythoncom.IID_IPersistFile)