Skip to content

Instantly share code, notes, and snippets.

@cr105ph1nx
cr105ph1nx / USTHB-ssi-resources.md
Last active January 4, 2025 17:58
Find here some resources you'll need to start your SSI journey... or survive through it ! Feel free to contribute if you've got resources of your own.
@timonweb
timonweb / gist:3165322
Created July 23, 2012 18:38
Code to catch all PHP errors which result in 500 Error Code. Include this snippet at the beginning of index.php file
<?php
define('E_FATAL', E_ERROR | E_USER_ERROR | E_PARSE | E_CORE_ERROR |
E_COMPILE_ERROR | E_RECOVERABLE_ERROR);
define('ENV', 'dev');
//Custom error handling vars
define('DISPLAY_ERRORS', TRUE);
define('ERROR_REPORTING', E_ALL | E_STRICT);
@ArmanTaheriGhaleTaki
ArmanTaheriGhaleTaki / automatic_FFMPEG_script
Created July 29, 2022 04:03
this is a bash script that compress MP4 formatted videos in a folder automatically and name the output as [Videoname] _compressed.mp4
#!/bin/bash
VIDEOS=$(ls *.mp4)
for VIDEO in $VIDEOS
do
ffmpeg -i $VIDEO -vcodec libx265 -crf 28 -f mp4 ${VIDEO%%.*}_compressed.mp4
done
@jurakovic
jurakovic / commit.sh
Last active January 4, 2025 17:54
Script for notes or "changelog" repo (more info here: https://news.ycombinator.com/item?id=42489124)
#!/bin/bash
git status -s
read -p "Press any key to show diff" -n1 -s; echo
git --no-pager diff
read -p "Press any key to stage all files" -n1 -s; echo
git add .
git status -s
@veekaybee
veekaybee / normcore-llm.md
Last active January 4, 2025 17:50
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

@joemccann
joemccann / asymmetric-coinbase-premium-indicator-tradingview.sh
Created January 3, 2025 13:58
Asymmetric Coinbase Premium Indicator for TradingView
//@version=5
//
// _____ __ .__
// / _ \ _________.__. _____ _____ _____/ |________|__| ____
// / /_\ \ / ___< | |/ \ / \_/ __ \ __\_ __ \ |/ ___\
// / | \\\___ \ \___ | Y Y \ Y Y \ ___/| | | | \/ \ \___
// \____|__ /____ >/ ____|__|_| /__|_| /\___ >__| |__| |__|\___ >
// \/ \/ \/ \/ \/ \/ \/
//
// Disclaimers: https://t.co/kOsUzy5pCB
@zulhfreelancer
zulhfreelancer / zsh-timestamp.md
Last active January 4, 2025 17:45
How to add timestamp on right hand side of ZSH / iTerm2 terminal prompt?

Add the following snippet at the bottom of ~/.zshrc file.

Option 1 - Just time

RPROMPT='[%D{%L:%M:%S}] '$RPROMPT
@nothke
nothke / AStarSearchNonAlloc.cs
Last active January 4, 2025 17:43
Vector2Int in description
// This is a C# example from Red Blob Games (https://www.redblobgames.com/pathfinding/a-star/implementation.html#csharp). Remade to have no GCAllocs
// Changes:
// - Made to work in Unity and draw gizmos on screen instead of console text;
// - Cache all collections in Init(), then when Search() is called, no allocs are being made;
// - Uses Unity's Vector2Int that avoids boxing when comparing structs;
// - graph.Neighbors() no longer uses an IEnumerable<>. instead, fill a list with neighbors;
using System;
using System.Collections.Generic;
using UnityEngine;
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active January 4, 2025 17:41
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@WhiteMinds
WhiteMinds / index.md
Last active January 4, 2025 17:39
我的开发哲学与实践整理

写在前面

  1. 本文的有一些哲学是摘自互联网中他人所撰写的,还有一些是与同行探讨获得的建议,其中一部分建议来自 bolasblack
  2. 本文主要针对多人协作开发的大型项目的场景,并且是基于 Magickbase 的一些项目进行的思考
  3. 本文默认读者是具备一定英文读写能力和开发能力的开发者
  4. 不要只是去背下这些规则,而是要尝试理解它们的意图(解决什么问题)和手段(怎么解决)

开发哲学(理念)

  1. 思想很重要,思想会指导你如何开发、遇到问题时做出怎样的选择(做决策)