Skip to content

Instantly share code, notes, and snippets.

"use strict";
var fs = require("fs");
let getLines = function getLines (filename, lineCount, callback) {
let stream = fs.createReadStream(filename, {
flags: "r",
encoding: "utf-8",
fd: null,
mode: 438, // 0666 in Octal
@application2000
application2000 / how-to-install-latest-gcc-on-ubuntu-lts.txt
Last active June 8, 2025 17:38
How to install latest gcc on Ubuntu LTS (12.04, 14.04, 16.04)
These commands are based on a askubuntu answer http://askubuntu.com/a/581497
To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below.
USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING.
ABSOLUTELY NO WARRANTY.
If you are still reading let's carry on with the code.
sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
@jagrosh
jagrosh / Github Webhook Tutorial.md
Last active July 17, 2025 23:46
Simple Github -> Discord webhook

Step 1 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send commits and other updates

  2. In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe! WebhookDiscord

Step 2 - Set up the webhook on Github

  1. Navigate to your repository on Github, and open the Settings Settings
@thousandlemons
thousandlemons / how-to-setup-shadowsocks-on-your-ubuntu-server.md
Last active January 1, 2025 15:58
How to setup Shadowsocks on your Ubuntu server
@codekoala
codekoala / export_chrome_passwords.js
Last active June 24, 2023 11:54
Dump all passwords saved in Google Chrome (tested with Chrome 56.0.2906.0 on Arch Linux)
// Modified version of https://github.com/megmage/chrome-export-passwords
//
// This script allows you to dump all of the passwords stored in your Chrome
// profile. I tested it with Chrome 56.0.2906.0 dev (64-bit) on Arch Linux and
// it worked quite well.
//
// Usage:
//
// - Navigate to chrome://settings-frame/passwords
// - Copy this code into a snippet in Chrome
window.grecaptcha = {
getResponse: function() {
return 'FAKE-RECAPTCHA-RESPONSE'
},
reset: function() {
console.log("FAKE-RECAPTCHA-RESET", arguments)
},
render: function() {
@balupton
balupton / next.config.js
Created February 3, 2017 16:00
next.js webpack configs
module.exports = {
webpack: (config) => {
const webpack = require('webpack')
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
config.plugins = config.plugins || []
config.plugins.push(new webpack.ContextReplacementPlugin(/moment[/\\]locale$/, /en/))
config.plugins.push(new BundleAnalyzerPlugin())
return config
}
}
@cdock1029
cdock1029 / index.js
Created March 18, 2017 22:30
firebase-functions express.js path fix
const app = require('express')();
// define your routes, etc ...
exports.route = functions.https.onRequest((req, res) => {
// https://some-firebase-app-id.cloudfunctions.net/route
// without trailing "/" will have req.path = null, req.url = null
// which won't match to your app.get('/', ...) route
@ingo-m
ingo-m / debian_install_cuda.md
Last active April 27, 2025 18:31
How to install CUDA on Debian

How to install CUDA on Debian 8 (Jessie)

This document describes how to install nvidia drivers & CUDA in one go on a fresh debian install.

Work in progress

Preparations

  • Start with a fresh Debian install.
@matthewjberger
matthewjberger / notes.md
Last active November 30, 2024 10:12
How to make an electron app using Create-React-App and Electron with Electron-Builder.