Skip to content

Instantly share code, notes, and snippets.

@yzdbg
yzdbg / auto-dr.md
Last active November 3, 2023 17:11

Automating Daily Reports, because fuck it, really...

Each day at our company, developers are required to document their activities, painstakingly jotting down their daily work and future plans. A monotonous chore that I just really dislike.

So now, there's a scribe for that :

auto-dr-

Code

\documentclass[11pt, oneside]{article}
\usepackage[margin=0.5in]{geometry}
\geometry{letterpaper}
\usepackage[parfill]{parskip}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{xcolor}
\pagecolor{white}
\usepackage[colorlinks = true, linkcolor = blue, urlcolor = blue]{hyperref}
\pagestyle{empty}
@hucancode
hucancode / README.md
Last active January 18, 2024 03:57
Flatten Strapi 4's response JSON

Update 29/11/2022

There is a plugin on Strapi Marketplace that do this response transforming stuffs in a more configurable way. Checkout this if you are interested.

@rithvikvibhu
rithvikvibhu / LICENSE
Last active April 22, 2024 15:25
Get tokens for Google Home Foyer API
MIT License
Copyright (c) 2020 Rithvik Vibhu
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@jescalan
jescalan / index.md
Last active May 8, 2017 18:25
Spike v1 Migration Guide

Spike v1 Migration Guide

Spike v1 represents a significant change, mostly because it includes an update from webpack v1 to webpack v2 behind the scenes. The aim of this piece is to guide you through the process of migration from one version to the next, and explain a bit of the rationale behind these changes.

App.js Updates

The bulk of the migration work lies in the app.js file. Webpack drastically changed its configuration in a very breaking manner between v1 and v2, so spike was forced to do the same, since spike is an extension of webpack.

Webpack Config Changes

@acdlite
acdlite / app.js
Last active January 20, 2023 08:23
Quick and dirty code splitting with React Router v4
// getComponent is a function that returns a promise for a component
// It will not be called until the first mount
function asyncComponent(getComponent) {
return class AsyncComponent extends React.Component {
static Component = null;
state = { Component: AsyncComponent.Component };
componentWillMount() {
if (!this.state.Component) {
getComponent().then(Component => {
@jescalan
jescalan / index.md
Last active August 16, 2016 20:27
Differences between jade and the spike-standards stack

Spike v0.11.0 Migration Guide

In this release of spike, we switch posthtml for reshape. Reshape is a complete rewrite of posthtml by the static-dev team with several significant differences:

  • It returns a function by default, so that its results can be used as client-side templates
  • It has a much more clear and robust error reporting system, reporting errors that include the line/col in the original source, and exposing a code snippet to show where it came from
  • It has more clearly written documentation, more thorough tests, consistent code style, and 100% coverage on all core modules

However, as a consequence of this move, the jade plugin is no longer available. The jade plugin was always a hack, and had several crippling caveats. In addition, jade does not fit well with reshape's philosophy of breaking functionality down into small modules. As such, we have replaced ja

#!/bin/bash
################################################################################
### OpenCV2 Installation Script ###
################################################################################
# Source code at https://github.com/arthurbeggs/scripts #
################################################################################
# #
# Feel free to copy and modify this file. Giving me credit for it is your #
# choice, but please keep references to other people's work, which I don't #
@baybatu
baybatu / split-into-subarrays.js
Last active March 11, 2021 03:47
Splitting array into list of subarrays in javascript
/*
* Splits array into subarrays.
* count parameter indicates that how many item per subarray contains.
* Example usage: splitIntoSubArray([1,2,3,4,5], 2) -> [[1, 2], [3, 4], [5]]
*/
function splitIntoSubArray(arr, count) {
var newArray = [];
while (arr.length > 0) {
newArray.push(arr.splice(0, count));
}
@ramirezd42
ramirezd42 / delay.js
Created January 25, 2016 07:30
Delay Effect with Web Audio API
var audioCtx = new (window.AudioContext || window.webkitAudioContext)();
var streamNode;
var masterNode;
var bypassNode;
var delayNode;
var feedbackNode;
//request an audio MediaStream track and save a reference to it
navigator.mediaDevices.getUserMedia({audio: true})
.then(stream => {