Skip to content

Instantly share code, notes, and snippets.

View ChocolateLoverRaj's full-sized avatar

Rajas Paranjpe ChocolateLoverRaj

View GitHub Profile
@BonsaiDen
BonsaiDen / tokenize.js
Created February 12, 2012 21:15
Small, simple, JS tokenizer in JS.
/**
* Simple JavaScript tokenizer (not a full parser!!!)
*
* Portions taken from Narcissus by Brendan Eich <brendan@mozilla.org>.
*/
/*jshint evil: true, regexdash: false, regexp: false */
var KEYWORDS = [
'break',
@mattbell87
mattbell87 / Steam-on-fedora.md
Last active April 13, 2024 00:36
How to install Steam on Fedora

Installing Steam on Fedora

These instructions are currently for Fedora 30. I'll update them over the releases if anything changes.

Open Software

Press the Win/Super key, type software and press Enter.

Enable the Third party and Steam repositories

@jagrosh
jagrosh / Github Webhook Tutorial.md
Last active July 7, 2024 15:31
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
@lightonphiri
lightonphiri / bash-install_google_fonts_on_ubuntu.md
Last active July 5, 2024 14:57
Install Google Fonts on Ubuntu

Install Google Fonts

Download desired fonts

https://fonts.google.com/?selection.family=Open+Sans

Install Google Fonts on Ubuntu

cd /usr/share/fonts
sudo mkdir googlefonts
cd googlefonts
sudo unzip -d . ~/Downloads/Open_Sans.zip

@inlife
inlife / uv_read_file.c
Created February 13, 2017 13:58
Sample for reading a file asynchronously using libuv
// Sample for reading a file asynchronously using libuv
// taken from https://www.snip2code.com/Snippet/247423/Sample-for-reading-a-file-asynchronously
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <uv.h>
static uv_fs_t openReq;
static uv_fs_t readReq;
@qntmpkts
qntmpkts / install-vsc.sh
Created September 17, 2017 17:53
Install Visual Studio Code Insiders in Crouton Chroot (ChromiumOS/ChromeOS)
#!/usr/bin/env sh
_install_vsc() {
echo "Re-entering chroot to complete installation..."
sudo enter-chroot -n ${1} sudo -S sh -c "curl -L https://go.microsoft.com/fwlink/?LinkID=760865 > /tmp/code-insiders.deb; sudo dpkg -i /tmp/code-insiders.deb; sudo apt-get install -f; rm /tmp/code-insiders.deb;";
if [ $? -eq 0 ]; then
echo "Code install script complete.";
else
echo "Code install script failed.";
exit 1;
@stonehippo
stonehippo / nodejs_raspberry_pi.md
Last active April 21, 2024 01:07
Methods for installing Node.js on Raspberry Pi

Setting Up Node.js On Raspberry Pi

There are several ways that you can set up Node.js on a Raspberry Pi when running Raspbian/Rapberry Pi OS. Depending on your needs, the version of the RPi that you're using, and how you like to manage installs, you have a lot of options.

Node.js from source

Do not do this if you can avoid it, it's super slow. If you insist on doing it and have the time, you can start at https://nodejs.org. But really, don't do this.

If you have tons of time on your hands, don't need Node anytime soon, and insist on building from source for some reason, here's a guide you can try out that covers building Node.js on an ARMv6 Raspberry Pi.

Side note: unless you have a need for the latest and greatest features, I recommend developing using the most recent Long Term Support (LTS) version of Node available, especially for anything you plan to put into production for any length of time.

@nijave
nijave / metered.ps1
Created June 23, 2019 14:56
Powershell check if on metered network
[void][Windows.Networking.Connectivity.NetworkInformation, Windows, ContentType = WindowsRuntime]
$cost = [Windows.Networking.Connectivity.NetworkInformation]::GetInternetConnectionProfile().GetConnectionCost()
$cost.ApproachingDataLimit -or $cost.OverDataLimit -or $cost.Roaming -or $cost.BackgroundDataUsageRestricted -or ($cost.NetworkCostType -ne "Unrestricted")
@Edu4rdSHL
Edu4rdSHL / luks-upgrade.md
Last active April 29, 2024 02:11 — forked from kravietz/luks-upgrade.md
Ubuntu LUKS cryptsetup upgrade

If you installed your #ubuntu with full-disk #encryption a while, you may want to upgrade your #luks header version to enjoy improved #security and stronger password hashing algorithms.

Boot from USB

You can't change LUKS header from a live system - you need to boot a live Ubuntu USB to be able to access the encrypted partition. First, create a bootable USB stick using a regular Ubuntu installer image.

  • Just get the latest installer ISO available
  • You need the full installer, the mini network installer won't work
  • You may need to disable Secure Boot in BIOS temporarily to boot from USB
@kabili207
kabili207 / Rclone systemd service.md
Last active June 24, 2024 11:31
Rclone systemd user service

rclone systemd service

Preparation

This service will use the same remote name you specified when using rclone config create. If you haven't done that yet, do so now.

Next, create the mountpoint for your remote. The service uses the location ~/mnt/<remote> by default.

mkdir ~/mnt/dropbox