Skip to content

Instantly share code, notes, and snippets.

View cds-amal's full-sized avatar
🏠
Working from home

cds-amal cds-amal

🏠
Working from home
  • Flushing USA
View GitHub Profile
@davidmurdoch
davidmurdoch / getLastCommitDatetimeUtc.ts
Last active December 15, 2023 15:17
A Node.js function to get the latest commit's authorship timestamp in UTC (millisecond precision)
/**
* Retrieves the datetime of the last commit in UTC for the current Git branch.
*
* The author timestamp is used for its consistency across different
* repositories and its inclusion in the Git commit hash calculation. This makes
* it a stable choice for reproducible builds.
*
* @returns Millisecond precision timestamp in UTC of the last commit on the
* current branch. If the branch is detached or has no commits, it will throw an
* error.

Arch Install

Notes about this "guide"

This is more-so notes for myself that would also be understandable for others.
It will NOT be an in-depth guide explaining my choices.
It will NOT tell you the function of every option for every command, as I assume you will look up any that you find interesting or confusing.
I WILL link to general info about the main parts being used, or if some info is harder to find.

This will guide you through the installation from after booting from the USB to booting Arch from your SSD/HDD.

Resulting installation

@yegappan
yegappan / VimScriptForPythonDevelopers.MD
Last active January 12, 2024 10:51
Vim script for Python Developers

Vim Script for Python Developers

This is a guide to Vim Script development for Python developers. Sample code for the various expressions, statements, functions and programming constructs is shown in both Python and Vim Script. This is not intended to be a tutorial for developing Vim scripts. It is assumed that the reader is familiar with Python programming.

For an introduction to Vim Script development, refer to usr_41.txt, eval.txt and Learn Vimscript the Hard Way

For a guide similar to this one for JavaScript developers, refer to Vim Script for the JavaScripter

This guide only describes the programming constructs that are present in both Python and Vim. The constructs that are unique to Vim (e.g. autocommands, [key-mapping](https://vimhelp.org/map.txt.html#key-m

@tmkelly28
tmkelly28 / nov3.hs
Created November 3, 2019 21:42
Doing some haskell
-- Functors
-- fmap :: (a -> b) -> f a -> f b
class MyFunctor f where
fmap :: (a -> b) -> f a -> f b
data Perhaps a = Surely a | Naught deriving (Show)
instance Eq a => Eq (Perhaps a) where
(Surely x) == (Surely y) = x == y
Naught == Naught = True
@ramantehlan
ramantehlan / README-Fancy.md
Last active May 10, 2024 14:28
README template I use for most of my projects.

Introduction

  • Add your project logo.
  • Write a short introduction to the project.
  • If you are using badges, add them here.

📒 Index

@threepointone
threepointone / for-snook.md
Last active August 26, 2023 15:43
For Snook

https://twitter.com/snookca/status/1073299331262889984?s=21

‪“‬In what way is JS any more maintainable than CSS? How does writing CSS in JS make it any more maintainable?”

‪Happy to chat about this. There’s an obvious disclaimer that there’s a cost to css-in-js solutions, but that cost is paid specifically for the benefits it brings; as such it’s useful for some usecases, and not meant as a replacement for all workflows. ‬

‪(These conversations always get heated on twitter, so please believe that I’m here to converse, not to convince. In return, I promise to listen to you too and change my opinions; I’ve had mad respect for you for years and would consider your feedback a gift. Also, some of the stuff I’m writing might seem obvious to you; I’m not trying to tell you if all people of some of the details, but it might be useful to someone else who bumps into this who doesn’t have context)‬

So the big deal about css-in-js (cij) is selectors.

@glebec
glebec / monadic-parser.js
Last active June 2, 2021 10:22
Monadic Parser demo
/**
* Minimal demo of parser combinators, possibly as a target for recent
* JS web dev graduates to implement as an exercise.
*
* Huge credit to Hutton, Meijer, and Swierstra for their papers
* on the subject.
*/
class Parser {
@rsp
rsp / GitHub-Project-Guidelines.md
Last active May 22, 2024 12:38
Git Strict Flow and GitHub Project Guidelines - setup rules and git flow for commercial and open-source projects by @rsp

Git Strict Flow and GitHub Project Guidelines

Or how to turn this:

into this:

Client v Server

Whenever we're dealing with web pages, we say that our browser (i.e. Chrome) is the "client" and the process running on the computer connected to the internet that sends a web page in response to the browser's request is the "server".

Remember that a server is just a process that sends data in response to certain requests. It knows how to respond to requests because the request is formatted using the HTTP protocol (and likewise, the client knows how to receive it because the response also adheres to the HTTP protocol). The computer running the "server process" exposes that process to the internet so that people can make requests to it.

At Fullstack, we like to say that the server is somewhere far away, like "Norway". This is because when you write your own server programs, they'll be running on the same machine as your browser, but this won't be the case in real life!

Getting Started with Express

@critesjosh
critesjosh / Contract_calls.sol
Last active February 20, 2024 10:45
CALL vs CALLCODE vs DELEGATECALL in Solidity
pragma solidity ^0.4.15;
contract C1 {
uint public num;
address public sender;
function callSetNum(address c2, uint _num) public {
if(!c2.call(bytes4(sha3("setNum(uint256)")), _num)) revert(); // C2's num is set
}