Skip to content

Instantly share code, notes, and snippets.

Problem

In Arch Linux mkinitcpio -p linux

shows

Possibly missing firmware for module: aic94xx
 Possibly missing firmware for module: wd719x
@anoopemacs
anoopemacs / git-change-commit-messages.md
Created June 12, 2018 04:11 — forked from nepsilon/git-change-commit-messages.md
How to change your commit messages in Git? — First published in fullweb.io issue #55

How to change your commit messages in Git?

At some point you’ll find yourself in a situation where you need edit a commit message. That commit might already be pushed or not, be the most recent or burried below 10 other commits, but fear not, git has your back 🙂.

Not pushed + most recent commit:

git commit --amend

This will open your $EDITOR and let you change the message. Continue with your usual git push origin master.

#! /usr/bin/env ruby
# usage:
# $ das_download.rb
require "mechanize"
require "fileutils"
class DasDownloader
attr_reader :agent, :email, :password
alert('hello ' + document.location.href);
function cb (err, res) {
return res;
}
function secondArg (oneName, cb) {
oneName = oneName + '___2';
cb(null, oneName)
}
var toDl = ['a', 'b', 'c', 'd'];
function sleep (time) {
return new Promise((resolve) => setTimeout(resolve, time));
}
// Usage!
sleep(500).then(() => {
// Do something after the sleep!
})
@anoopemacs
anoopemacs / js random string of length N
Created September 8, 2016 13:37
random string js
(Math.random().toString(36)+'00000000000000000').slice(2, N+2)
// The resulting string will be twice as long as the random bytes you generate;
// each byte encoded to hex is 2 characters. 20 bytes will be 40 characters of hex.
require('crypto').randomBytes(48, function(err, buffer) {
var token = buffer.toString('hex');
});
// synchronous version
var token = require('crypto').randomBytes(64).toString('hex');
var fs = require('fs');
fs.writeFile("/tmp/test", "Hey there!", function(err) {
if(err) {
return console.log(err);
}
console.log("The file was saved!");
});
@anoopemacs
anoopemacs / c input accept from console.txt
Created August 27, 2016 20:27
loop until a blank line or EOF
char buf[2];
while (scanf("%1[\n]", buf) == 0) { // loop until a blank line or EOF