Skip to content

Instantly share code, notes, and snippets.

View madebycollins's full-sized avatar

Collins Zimba madebycollins

View GitHub Profile
@malarkey
malarkey / Contract Killer 3.md
Last active May 17, 2024 15:28
The latest version of my ‘killer contract’ for web designers and developers

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008

…………………………

@EtienneLem
EtienneLem / ajax_worker.js
Created June 10, 2013 19:40
Ajax Web Worker
var handleRequest = function(data) {
postMessage(data)
}
addEventListener('message', function(e) {
var xhr = new XMLHttpRequest
xhr.open('GET', e.data)
xhr.onreadystatechange = function(e) {
if (xhr.readyState === 4 && xhr.status === 200) {
handleRequest(xhr.responseText)
@grenade
grenade / 01-generate-ed25519-ssh-key.sh
Last active May 2, 2024 23:15
generate ed25519 ssh and gpg/pgp keys and set file permissions for ssh keys and config
#!/bin/bash
# generate new personal ed25519 ssh key
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "rob thijssen <rthijssen@gmail.com>"
# generate new host cert authority (host_ca) ed25519 ssh key
# used for signing host keys and creating host certs
ssh-keygen -t ed25519 -f manta_host_ca -C manta.network
eval "$(ssh-agent -s)"
@primozcigler
primozcigler / themeforest-contract.md
Last active August 19, 2021 02:41 — forked from malarkey/Contract Killer 3.md
Modified version of @malarkey's Killing Contract for use for the ThemeForest cooperation (more dev to dev team than dev to client).

Contract for developing a Drupal theme for selling on the ThemeForest

Between us: [ProteusNet d.o.o., Rudarska cesta 11, 8281 Senovo, Slovenia, EU] and you: [partner]

Summary:

We’ll always do our best to fulfil the scope of this cooperation, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.

So in short;

@joshuapekera
joshuapekera / gitflow.md
Created June 28, 2014 21:09
Git-Flow Cheat Sheet
@leotm
leotm / findAndReplace.js
Last active March 22, 2022 13:37
Node.js - Find and Replace file(s)
var glob = require('glob');
var fs = require('fs');
var replace = require('replace');
// Find file(s)
glob('fileName.txt', function(err, files) {
if (err) { throw err; }
files.forEach(function(item, index, array) {
console.log(item + ' found');
@joepie91
joepie91 / vpn.md
Last active May 17, 2024 15:29
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.
@adeekshith
adeekshith / .git-commit-template.txt
Last active February 21, 2024 12:06 — forked from Linell/.git-commit-template.txt
This commit message template helps you write great commit messages and enforce it across teams.
# <type>: (If applied, this commit will...) <subject> (Max 50 char)
# |<---- Using a Maximum Of 50 Characters ---->|
# Explain why this change is being made
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
# Provide links or keys to any relevant tickets, articles or other resources
# Example: Github issue #23
@vlucas
vlucas / encryption.js
Last active May 17, 2024 12:11
Stronger Encryption and Decryption in Node.js
'use strict';
const crypto = require('crypto');
const ENCRYPTION_KEY = process.env.ENCRYPTION_KEY; // Must be 256 bits (32 characters)
const IV_LENGTH = 16; // For AES, this is always 16
function encrypt(text) {
let iv = crypto.randomBytes(IV_LENGTH);
let cipher = crypto.createCipheriv('aes-256-cbc', Buffer.from(ENCRYPTION_KEY), iv);
@ahmedengu
ahmedengu / index.js
Created March 10, 2017 03:26
Paddle.com Verifying Webhooks ( Signature ) for nodejs/expressjs , https://paddle.com/docs/reference-verifying-webhooks
/*
1- Install(using npm): Express, body-parser, php-serialize, crypto
* npm install --save express body-parser php-serialize crypto
2- read Paddle docs: https://paddle.com/docs/reference-verifying-webhooks
3- GoTo line 32 to set your public key, available here: https://vendors.paddle.com/account
4- Run it
5- Send post request to http://localhost:8080/paddleWebhook
* you can use https://requestb.in to get the payload from paddle request simulator
* paddle simulator (Webhook Alert Testing) : https://vendors.paddle.com/webhook-alert-test
6- Testing result should be like this: