Skip to content

Instantly share code, notes, and snippets.

@markthiessen
markthiessen / getWeeksInMonth.js
Last active April 25, 2024 02:05
JavaScript - get weeks in a month as array of start and end days
//note: month is 0 based, just like Dates in js
function getWeeksInMonth(year, month) {
const weeks = [],
firstDate = new Date(year, month, 1),
lastDate = new Date(year, month + 1, 0),
numDays = lastDate.getDate();
let dayOfWeekCounter = firstDate.getDay();
for (let date = 1; date <= numDays; date++) {
@animoplex
animoplex / SimpleTriggerFade.jsx
Created December 22, 2018 00:59
Simple Trigger Fade - After Effects Expression by Animoplex
// Simple Trigger Fade - Created by Animoplex: www.animoplex.com
// Repeat a fade animation multiple times using markers to trigger the animation.
// Full Tutorial: https://www.youtube.com/watch?v=B_3XS2-VWOM
fadeFrames = 30; m = 0; t = time;
if (marker.numKeys > 0) {
m = marker.nearestKey(time).index;
tag = marker.key(m).comment;
if (tag == "In") { t = marker.key(m).time - time }
else if (tag == "Out") { t = time - marker.key(m).time }
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active April 25, 2024 02:01
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@abirfo
abirfo / git-http-proto.txt
Last active April 25, 2024 02:01 — forked from schacon/git-http-proto.txt
Git HTTP transport protocol documentation
HTTP transfer protocols
=======================
Git supports two HTTP based transfer protocols. A "dumb" protocol
which requires only a standard HTTP server on the server end of the
connection, and a "smart" protocol which requires a Git aware CGI
(or server module). This document describes both protocols.
As a design feature smart clients can automatically upgrade "dumb"
protocol URLs to smart URLs. This permits all users to have the
@bettysteger
bettysteger / Editorjs.vue
Last active April 25, 2024 01:58
Vue 3 SFC for Editor.js using v-model with own custom vue component
<template>
<div class="editorjs" ref="htmlelement"></div>
</template>
<script setup>
import EditorJS from '@editorjs/editorjs';
import EmbedTool from '@editorjs/embed';
import ListTool from '@editorjs/list';
import ImageTool from '@editorjs/image';
import VideoTool from './editorjs/video.js';
import { onMounted, onUnmounted, ref, watch } from 'vue';
@yrevar
yrevar / imagenet1000_clsidx_to_labels.txt
Last active April 25, 2024 01:57
text: imagenet 1000 class idx to human readable labels (Fox, E., & Guestrin, C. (n.d.). Coursera Machine Learning Specialization.)
{0: 'tench, Tinca tinca',
1: 'goldfish, Carassius auratus',
2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias',
3: 'tiger shark, Galeocerdo cuvieri',
4: 'hammerhead, hammerhead shark',
5: 'electric ray, crampfish, numbfish, torpedo',
6: 'stingray',
7: 'cock',
8: 'hen',
9: 'ostrich, Struthio camelus',
@breekoy
breekoy / centos7-nginx-laravel-configuration
Last active April 25, 2024 01:57
Configuration steps on CentOS7 server to run Laravel applications + Redis and Node.JS on nginx
==== CENTOS 7 LEMP STACK INSTALLATION ====
0. Make sure the centos 7 server have internet connection
1. Install the EPEL Repository
sudo yum -y install epel-release
2. Install the Remi Repository
sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
3. Install Nginx
@uupaa
uupaa / image.resize.in.github.flavored.markdown.md
Last active April 25, 2024 01:57
image resize in github flavored markdown.

Image source

https://gyazo.com/eb5c5741b6a9a16c692170a41a49c858.png

Try resize it!

  • ![](https://gyazo.com/eb5c5741b6a9a16c692170a41a49c858.png | width=100)
@berkorbay
berkorbay / github_desktop_ubuntu.md
Last active April 25, 2024 01:56
To install Github Desktop for Ubuntu

IMPORTANT

See the following links for further updates to Github Desktop for Ubuntu. These are official instructions. (also mentioned by fetwar on Nov 3, 2023)

For the sake of "maintaining the tradition" here is the updated version.