Skip to content

Instantly share code, notes, and snippets.

View jaspreetsidhu's full-sized avatar
🎯
Focusing

Jaspreet jaspreetsidhu

🎯
Focusing
View GitHub Profile
@jaspreetsidhu
jaspreetsidhu / Pardot Javascript
Created May 22, 2019 12:56
Pardot Javascript UTM
<script type="text/javascript">
// Parse the URL
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
// Give the URL parameters variable names
var source = getParameterByName('utm_source');
@magn2o
magn2o / wpa_supplicant.sh
Created February 10, 2020 02:25
init.d style service script for wpa_supplicant on the UDMPro.
#!/bin/sh
set -eu -o pipefail
CONTAINER_NAME="wpa_supplicant"
IMAGE_NAME="pbrah/wpa_supplicant-udmpro"
IMAGE_TAG="v1.0"
MAC_ADDRESS=""
ETH_IFACE="eth8"
@zcaceres
zcaceres / Sequelize-Step-by-Step.md
Last active February 22, 2023 12:53
Let's get an overview of Sequelize!

Sequelize: Step-By-Step

Sequelize is a powerful library in Javascript that makes it easy to manage a SQL database. Sequelize can layer over different protocols, but here we'll use PostgreSQL. At its core, Sequelize is an Object-Relational Mapper – meaning that it maps an object syntax onto our database schemas. Sequelize uses Node.JS and Javascript's object syntax to accomplish its mapping.

Under the hood, Sequelize used with PostgreSQL is several layers removed from our actual database:

  1. First, we write our Sequelize, using Javascript objects to mimic the structure of our database tables.
  2. Sequelize creates a SQL string and passes it to a lower-level library called pg (PostgreSQL).
  3. pg connects to your PostgreSQL database and queries it or transforms its data.
  4. pg passes the data back to Sequelize, which parses and returns that data as a Javascript object.
@qntmpkts
qntmpkts / .bashrc
Last active October 13, 2023 20:14
For use on ChromeOS with zsh and oh-my-zsh installed
# /etc/skel/.bashrc
if [[ $- != *i* ]] ; then
# Shell is non-interactive. Be done now!
return
fi
exec /usr/local/bin/zsh
@n0531m
n0531m / install_basics.sh
Last active December 26, 2023 01:51
setting up my chromebook
##!/bin/bash
## setting up the least to a clean linux env on a chromebook
## mostly a copy&paste from instructions found on the web, which is why the approach is not consistent...
## i might clean it up in the future but as long as it works it does the job.
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install apt-transport-https ca-certificates gnupg software-properties-common apt-utils
@sjfricke
sjfricke / ChromeBookDev.md
Last active December 26, 2023 01:53
Configuring Chromebook for Development

These instructions will not work on Chromebooks with an ARM processor. If you have an ARM processor then you cannot install Chromebrew to get git. You'll need to instead install crouton. Here are instructions that you can follow: https://github.com/macton/arch-linux-install-notes/tree/master/arm-chromebook-chroot

@Note: This is a fork from /erikpmp who has left github, here is a fork I took before thankfully

Configuring Chromebook for Development

After a full Sunday of trial and error, and stepping through many semi-complete or dated blog posts explaining how to do this, I was able to get the Chromebook into developer mode, install git, Node.js, and NPM.

Here's what I did...

@Bnux256
Bnux256 / Crostini.md
Last active December 26, 2023 09:04
Chromebook Crostini Python Development Setup

Chromebook Crostini Python Development Setup

Updating the Debian container

sudo apt update
sudo apt dist-upgrade

Installing Nano

sudo apt install nano

Installing Python

sudo apt-get install python3 python3-dev python3-pip\

@thibaultmol
thibaultmol / .crostini-setup
Last active January 24, 2024 21:44 — forked from tjpalanca/.crostini-setup
Crostini Setup
These scripts set up Crostini on my Acer Chromebook Spin 13
wget https://gist.githubusercontent.com/thibaultmol/aaf275a0bb36ba4aa8481e845aeb3135/raw/setup-crostini.sh \
&& chmod +x ./setup-crostini.sh

[AIO] Ultimate AdBlocking+AdBypassing Guide (Firefox/Chrome/Brave - Windows/Linux)

Last Updated: September 12, 2023

Why We Need To Block Ads From Internet?

The Internet is a vast space of infinite knowledge. We can store and access those knowledge, those data from everywhere and from any device. We just need to use correct words or phrases to find them. But often what we get is not exactly Safe to See, it's not annoyance-free.

@OoHerbethoO
OoHerbethoO / Smartphone USB Tethering to an OpenWrt router
Created July 12, 2020 15:09
USB tethering is used to connect your OpenWrt Router to the Internet by using the your smartphone. It's more convenient and has better performance (lower latency) than turning your smartphone into an access point and using that. It also is less of a CPU load on your phone, charges your phone, and allows you the flexibility of doing things with y…
Installation
For the easiest installation, have a wired ethernet upstream internet connection to boot-strap this process. You will need: the router, your tethering phone, necessary cables, a laptop and an upstream internet connection via ethernet for initial setup. Instead of a wired upstream connection to plug into the router WAN port, is also possible to download necessary packages below, through your laptop while tethered to your phone, the same way you can get the OpenWrt distribution for your router. That is not covered in this guide.
Once OpenWRT is installed on the router,
Install some Kernel packages to get USB tethering support: Go to http://192.168.1.1 and log in to the router. Click on System, Administration, and SSH. Set the 'Interface' to 'LAN', then click 'Save & Apply'. You can now use an SSH client like Putty to connect to the router and issue commands. SSH into the router on 192.168.1.1 and log in.
Enter the commands:
opkg update