Skip to content

Instantly share code, notes, and snippets.

@AnoRebel
AnoRebel / python-es6-comparison.md
Created February 12, 2020 22:34 — forked from revolunet/python-es6-comparison.md
# Python VS ES6 syntax comparison

Python VS ES6 syntax comparison

Python syntax here : 2.7 - online REPL

Javascript ES6 via Babel transpilation - online REPL

Imports

import math
@AnoRebel
AnoRebel / stuns
Created February 17, 2020 17:19 — forked from zziuni/stuns
STUN server list
# source : http://code.google.com/p/natvpn/source/browse/trunk/stun_server_list
# A list of available STUN server.
stun.l.google.com:19302
stun1.l.google.com:19302
stun2.l.google.com:19302
stun3.l.google.com:19302
stun4.l.google.com:19302
stun01.sipphone.com
stun.ekiga.net
@AnoRebel
AnoRebel / README.md
Created February 21, 2020 12:36 — forked from joyrexus/README.md
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@AnoRebel
AnoRebel / bottom_sheet.dart
Created June 17, 2020 12:07 — forked from slightfoot/bottom_sheet.dart
Modal Bottom Sheet with Input Fields fix for Flutter (Fix issue with overlap with keyboard and fix for tapping to dismiss)
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
@AnoRebel
AnoRebel / custom_bottom_sheet.dart
Created June 17, 2020 13:55 — forked from drewpayment/custom_bottom_sheet.dart
Hack to fix Flutter not scrolling TextField and TextFormField into view to take viewInset of keyboard into account.
import 'package:flutter/material.dart';
class CustomBottomSheet {
static Future<T> showScrollingModalBottomSheet<T>({
@required BuildContext context,
bool isScrollControlled = true,
ShapeBorder shape,
double heightPercView = 0.95,
@AnoRebel
AnoRebel / emoji-toggle.md
Created July 5, 2020 18:06 — forked from HikariKnight/emoji-toggle.md
ibus emoji toggle
#!/bin/bash
#### CONFIG
ibus_default_layout="xkb:no::nor"
layout="no"
#### END OF CONFIG

ibus_layout=$(ibus engine)
if [[ "$ibus_layout" == $ibus_default_layout ]]; then
 echo Setting ibus to uniemoji
@AnoRebel
AnoRebel / app.js
Created September 22, 2020 17:02 — forked from eskiel777/app.js
Express.js role-based permissions middleware
// the main app file
import express from "express";
import loadDb from "./loadDb"; // dummy middleware to load db (sets request.db)
import authenticate from "./authentication"; // middleware for doing authentication
import permit from "./permission"; // middleware for checking if user's role is permitted to make request
const app = express(),
api = express.Router();
// first middleware will setup db connection
@AnoRebel
AnoRebel / git-overwrite-branch.sh
Created November 2, 2020 16:02 — forked from ummahusla/git-overwrite-branch.sh
Git overwrite branch with another branch
# overwrite master with contents of feature branch (feature > master)
git checkout feature # source name
git merge -s ours master # target name
git checkout master # target name
git merge feature # source name
@AnoRebel
AnoRebel / pdfreader.py
Created December 26, 2020 16:54
A python script that takes in a PDF file and reads it to/for you
#!/usr/bin/env python3
import sys
import argparse
# External requirements, install with pip
import pyttsx3
import PyPDF2
parser = argparse.ArgumentParser(description="Audio PDF file reader.")
parser.add_argument("-n", "--name", help="Name/Path of PDF file to read")
@AnoRebel
AnoRebel / loc
Created February 4, 2021 10:02 — forked from akatrevorjay/loc
loc: mlocate + fzf integration
#!/usr/bin/env zsh
#
# loc: mlocate + fzf integration
#
# https://gist.github.com/06dc1238b2fcbfb6c10bbad05ad79bc1
# https://asciinema.org/a/102006
#
# ~ trevorj <[email protected]>
#
setopt pipe_fail err_return err_exit