Skip to content

Instantly share code, notes, and snippets.

View darlanalves's full-sized avatar
🏠
Writing some code when I'm not busy writing code

Darlan Alves darlanalves

🏠
Writing some code when I'm not busy writing code
View GitHub Profile
@danielkucera
danielkucera / compal-decrypt.c
Last active July 3, 2023 23:02
compal-decrypt.c
/*
Program for decrypting Compal CH7465LG private key
Compilation:
gcc -o compal-decrypt compal-decrypt.c -lcrypto
Running:
./compal-decrypt
usage: ./compal-decrypt <infile> <outfile>
@NeoCat
NeoCat / esp8266-amg8833.ino
Last active December 15, 2023 15:11
ESP8266 + AMG8833 WebSocket-based Viewer
// ESP8266 Pins
// 4(SDA) --- AMG8833 SDA
// 5(SCL) --- AMG8833 SCL
// 13 --- LED (Anode) via 100ohm
#include <pgmspace.h>
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <WebSocketsServer.h>
@stigok
stigok / githook.js
Last active July 8, 2024 14:56
Verify GitHub webhook signature header in Node.js
/*
* Verify GitHub webhook signature header in Node.js
* Written by stigok and others (see gist link for contributor comments)
* https://gist.github.com/stigok/57d075c1cf2a609cb758898c0b202428
* Licensed CC0 1.0 Universal
*/
const crypto = require('crypto')
const express = require('express')
const bodyParser = require('body-parser')
anonymous
anonymous / config.json
Created September 28, 2015 05:30
Bootstrap Customizer Config
{
"vars": {},
"css": [
"forms.less",
"buttons.less"
],
"js": []
}
@demisx
demisx / gulpfile.js
Last active July 14, 2022 16:06
Gulp 4 gulpfile.js
// Gulp 4
var gulp = require('gulp');
var using = require('gulp-using');
var grep = require('gulp-grep');
var changed = require('gulp-changed');
var del = require('del');
var coffee = require('gulp-coffee');
var less = require('gulp-less');
var coffeelint = require('gulp-coffeelint');
var sourcemaps = require('gulp-sourcemaps');
@Edward-Lombe
Edward-Lombe / equals.js
Last active March 28, 2017 18:38
Strict Deep Javascript equality
beforeEach(function() {
jasmine.addMatchers({
toStrictlyEqual : function() {
return {
compare : function(actual, expected) {
var result = {};
result.pass = equals(actual, expected, function (a, b, sPath) {
result.message = 'Expected ' + sPath + ' = ' + b + ' to equal ' + a;
});
return result;

Screencapture and animated gifs

I say "animated gif" but in reality I think it's irresponsible to be serving "real" GIF files to people now. You should be serving gfy's, gifv's, webm, mp4s, whatever. They're a fraction of the filesize making it easier for you to deliver high fidelity, full color animation very quickly, especially on bad mobile connections. (But I suppose if you're just doing this for small audiences (like bug reporting), then LICEcap is a good solution).

Capturing (Easy)

  1. Launch quicktime player
  2. do Screen recording

screen shot 2014-10-22 at 11 16 23 am

@somegeekintn
somegeekintn / Developer Quotes
Created July 31, 2014 16:00
An assortment of quotes mostly related to software development
Computers are useless. They can only give you answers.
- Pablo Picasso
You know you've achieved perfection in design, not when you have nothing more to add, but when you have nothing more to take away.
- Antoine de Saint-Exupery, Wind, Sand and Stars
It always takes longer than you expect, even when you take into account Hofstadter's Law.
- Hofstadter's Law
Simplicity carried to the extreme becomes elegance.
@eevee
eevee / spabs.md
Last active February 20, 2024 08:29
tabs to spaces
@domenic
domenic / interop.md
Last active July 7, 2022 19:47
`module.exports =` and ES6 Module Interop in Node.js

module.exports = and ES6 Module Interop in Node.js

The question: how can we use ES6 modules in Node.js, where modules-as-functions is very common? That is, given a future in which V8 supports ES6 modules:

  • How can authors of function-modules convert to ES6 export syntax, without breaking consumers that do require("function-module")()?
  • How can consumers of function-modules use ES6 import syntax, while not demanding that the module author rewrites his code to ES6 export?

@wycats showed me a solution. It involves hooking into the loader API to do some rewriting, and using a distinguished name for the single export.

This is me eating crow for lots of false statements I've made all over Twitter today. Here it goes.