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
@cds-amal
cds-amal / VimScriptForPythonDevelopers.MD
Created May 25, 2020 08:35 — forked from yegappan/VimScriptForPythonDevelopers.MD
Vim script for Python Developers

Vim Script for Python Developers

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 programming in Python.

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


Variables

@cds-amal
cds-amal / explanation.md
Created March 16, 2020 14:46 — forked from masak/explanation.md
How is git commit sha1 formed

Ok, I geeked out, and this is probably more information than you need. But it completely answers the question. Sorry. ☺

Locally, I'm at this commit:

$ git show
commit d6cd1e2bd19e03a81132a23b2025920577f84e37
Author: jnthn <[email protected]>
Date:   Sun Apr 15 16:35:03 2012 +0200

When I added FIRST/NEXT/LAST, it was idiomatic but not quite so fast. This makes it faster. Another little bit of masak++'s program.

@cds-amal
cds-amal / nov3.hs
Created November 3, 2019 21:43 — forked from tmkelly28/nov3.hs
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
@cds-amal
cds-amal / GitHub-Project-Guidelines.md
Created October 21, 2019 13:19 — forked from rsp/GitHub-Project-Guidelines.md
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:

@cds-amal
cds-amal / README-Fancy.md
Created October 21, 2019 13:16 — forked from ramantehlan/README-Fancy.md
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

@cds-amal
cds-amal / combinators.js
Created January 25, 2019 20:26 — forked from Avaq/combinators.js
Common combinators in JavaScript
const I = x => x;
const K = x => y => x;
const A = f => x => f(x);
const T = x => f => f(x);
const W = f => x => f(x)(x);
const C = f => y => x => f(x)(y);
const B = f => g => x => f(g(x));
const S = f => g => x => f(x)(g(x));
const P = f => g => x => y => f(g(x))(g(y));
const Y = f => (g => g(g))(g => f(x => g(g)(x)));
@cds-amal
cds-amal / npm-freeze.sh
Created December 8, 2018 17:38 — forked from nagapavan/npm-freeze.sh
npm hacks
function npm-freeze() {
# npm ls | grep -E "^(├|└)─" | cut -d" " -f2 | awk -v quote='"' 'BEGIN { FS = "@" } ; { print quote $1 quote,":",quote $2 quote"," }' | sed -e 's/ :/:/g'
entries=`npm list --depth=0 -prod true "$@" 2>/dev/null | grep -v "UNMET PEER DEPENDENCY\|peer dep missing" | grep -E "^(├|└)─" | cut -d" " -f2`
echo '"dependencies" : {'
for entry in ${entries}; do
if [[ $entry =~ ^@.* ]]; then
# echo $entry
echo $entry | awk -v quote='"' -v attherate='@' 'BEGIN { FS = "@" }; { print quote attherate $1$2 quote,":",quote $3 quote"," }'
else
@cds-amal
cds-amal / gist:e9b5e0ad44f4a5a11b9f91e857435122
Created October 7, 2018 15:28 — forked from christofluethi/gist:646ae60d797a46a706a5
Convert m4a to mp3 on OS X command line using ffmpeg
brew update
brew link yasm
brew link x264
brew link lame
brew link xvid
brew install ffmpeg
ffmpeg wiki:
https://trac.ffmpeg.org/wiki/Encode/MP3
@cds-amal
cds-amal / node-modules-in-react-native.md
Created July 30, 2018 17:49 — forked from parshap/node-modules-in-react-native.md
Running Node Modules in React Native

Running Node Modules in React Native

How to use packages that depend on Node.js core modules in React Native.

Node.js Core Modules

Node has several modules that are automatically available via require(): http, crypto, etc. While these modules are available in Node, they are not automatically available in other environments

@cds-amal
cds-amal / gubberment.sol
Created July 25, 2018 21:32 — forked from WizardOfAus/gubberment.sol
UselessReserveBank Contract
pragma solidity ^0.4.11;
// ----------------------------------------------------------------------------
// The Useless Reserve Bank Token Contract
//
// - If you need welfare support, claim your free URB token entitlements from
// the gubberment.
//
// Call the default function `()` to claim 1,000 URBs by sending a 0 value
// transaction to this contract address.