Skip to content

Instantly share code, notes, and snippets.

View abd1rahmane's full-sized avatar
🏠
Working from home

Abd Rahmane abd1rahmane

🏠
Working from home
  • Chrome browser
View GitHub Profile
@abd1rahmane
abd1rahmane / adapter.py
Last active August 17, 2023 18:39
dj_rest_auth custom adapter for all most cases
View adapter.py
import warnings
from django.conf import settings
from django.template.loader import render_to_string
from django.template import TemplateDoesNotExist
from django.contrib.sites.models import Site
from django.core.mail import EmailMultiAlternatives, EmailMessage
from django.utils.translation import ugettext_lazy as _
from django import forms
@abd1rahmane
abd1rahmane / reset.css
Created November 1, 2022 18:03 — forked from DavidWells/reset.css
CSS reset. Follow me on the twitters for more tips: https://twitter.com/davidwells
View reset.css
/* http://meyerweb.com/eric/tools/css/reset/
v2.0-modified | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
@abd1rahmane
abd1rahmane / tailwind.config.js
Created May 3, 2022 20:05
tailwind.config.js
View tailwind.config.js
// tailwind.config.js
module.exports = {
theme: {
extend: {
colors: {
emerald: {
'50': '#ecf4f3',
'100': '#caefef',
'200': '#8fe7db',
'300': '#55cfb4',
@abd1rahmane
abd1rahmane / setup.sh
Created October 26, 2021 19:27
Xfce4 and XRDP on Ubuntu Server.
View setup.sh
echo "[+] Installing ..."
sudo apt update -y
sudo apt upgrade -y
sudo apt install xrdp
sudo systemctl start xrdp
sudo systemctl enable xrdp
sudo adduser xrdp ssl-cert
echo "[!] Select lightdm."
sudo apt install xubuntu-desktop
echo xfce4-session >~/.xsession
@abd1rahmane
abd1rahmane / Index.html
Created June 25, 2021 20:56
[Fork] johnlewis.ie
View Index.html
Skip to content
johnlewis.ie Linux Hackz 'n' Stuffz
About custom Chromebook firmware ROM Archive FAQ ROM Download
ROM Download
Please note: I no longer maintain, provide, or support custom Chromebook firmware; this page is left here for archive purposes only.
This page contains a command to download and run a script, which will flash custom firmware with a SeaBIOS payload on approaching 40 models of Intel based Chromebook – allowing you to run an alternative OS such as Linux. The script will work with ChromeOS or pretty much any Linux distro (at least no one has told me otherwise).
There are 3 types of firmware mod – RW_LEGACY, BOOT_STUB, and Full ROM – not all Chromebooks work with each one:
RW_LEGACY modifies a 2MB section of the ROM leaving the stock functionality intact, including the scary developer screen, and will not brick your device. Some Chromebooks already come with a working RW_LEGACY slot, although many of them do not (non-functional keyboard on Panther, non-functional display on Auron_Yuna,
@abd1rahmane
abd1rahmane / index.js
Created June 25, 2021 00:17
Loading WASM in NodeJS
View index.js
const fs = require("fs");
async function loadWASM(pathToWasm) {
/**
* A helper function to load Wasm.
*/
try {
const buf = fs.readFileSync(pathToWasm);
const { instance } = await WebAssembly.instantiate(new Uint8Array(buf));
return instance;
@abd1rahmane
abd1rahmane / addTwo.wast
Created June 17, 2021 21:39 — forked from kanaka/addTwo.wast
Run wast (WebAssembly) in node
View addTwo.wast
(module
(func $addTwo (param i32 i32) (result i32)
(i32.add
(get_local 0)
(get_local 1)))
(export "addTwo" (func $addTwo)))
@abd1rahmane
abd1rahmane / client.js
Created March 7, 2021 19:38 — forked from crtr0/client.js
A simple example of setting-up dynamic "rooms" for socket.io clients to join
View client.js
// set-up a connection between the client and the server
var socket = io.connect();
// let's assume that the client page, once rendered, knows what room it wants to join
var room = "abc123";
socket.on('connect', function() {
// Connected, let's sign-up for to receive messages for this room
socket.emit('room', room);
});
View .prettierrc.json
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "all",
"bracketSpacing": true,
"jsxBracketSameLine": false,
"arrowParens": "avoid",
@abd1rahmane
abd1rahmane / index.js
Last active June 17, 2021 21:40
Axios with Proxy
View index.js
const axios = require("axios");
const { HttpProxyAgent, HttpsProxyAgent } = require("hpagent");
let useProxy = true
if (useProxy) {
var proxy = "http://USERNAME:PASSWORD@PROXYIP:PROXYPORT";
const httpsAgent = new HttpsProxyAgent({
keepAlive: true,
keepAliveMsecs: 2000,