Skip to content

Instantly share code, notes, and snippets.

@KhanradCoder
KhanradCoder / PyDa.py
Created Apr 11, 2020
Code for the video where we build a Jarvis like virtual assistant in python 3
View PyDa.py
import wolframalpha
client = wolframalpha.Client("lilpumpsaysnopeeking")
import wikipedia
import PySimpleGUI as sg
sg.theme('DarkPurple')
layout =[[sg.Text('Enter a command'), sg.InputText()],[sg.Button('Ok'), sg.Button('Cancel')]]
window = sg.Window('PyDa', layout)
@Zearin
Zearin / python_decorator_guide.md
Last active Aug 3, 2021
The best explanation of Python decorators I’ve ever seen. (An archived answer from StackOverflow.)
View python_decorator_guide.md

NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.


Q: How can I make a chain of function decorators in Python?


If you are not into long explanations, see [Paolo Bergantino’s answer][2].

@AO8
AO8 / table_writer.py
Last active Aug 3, 2021
Convert an HTML table into a CSV file with Python and BeautifulSoup.
View table_writer.py
# Adapted from example in "Web Scraping with Python, 2nd Edition" by Ran Mitchell.
import csv
from urllib.request import urlopen
from bs4 import BeautifulSoup
html = urlopen("http://en.wikipedia.org/wiki/"
"Comparison_of_text_editors")
soup = BeautifulSoup(html, "html.parser")
table = soup.findAll("table", {"class":"wikitable"})[0]
View countryCodes.js
export default [
{
text: "Afghanistan (+93)",
value: "+93",
flag: "af",
key: "af",
},
{
text: "Aland Islands",
value: "",
@rickdaalhuizen90
rickdaalhuizen90 / .bashrc
Created Feb 12, 2017
Parrot Os bash theme for ubuntu
View .bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
View policy.json
{
"Version": "2012-10-17",
"Statement": [
{
"Action": "ec2:*",
"Effect": "Allow",
"Resource": "*"
},
{
"Effect": "Allow",
@jeremyzilar
jeremyzilar / trello.md
Last active Aug 3, 2021
Copy Trello Board as text or markdown
View trello.md

Copy Trello Board as text or markdown

Wouldn't it be nice to copy out your Trello board as plain text or markdown to be able to put it in a weekly memo, shipping notice or release notes? Now you can!

How to use this

Copy this line of JS and paste it into the CONSOLE in your browser. The results will be saved to your clipboard.

Option 1: Copy your Trello Board as Markdown

This will copy your columns + cards as markdown right to left

var s = []; s.push("# " + jQuery(".board-header").children()[0].innerText); jQuery.fn.reverse = [].reverse; jQuery(".list:has(.list-header-name)").reverse().each(function() {s.push("\n## " + jQuery(this).find(".list-header-name-assist")[0].innerText + "\n"); jQuery(this).find(".list-card-title").each(function() {s.push("* " + this.innerText); }); }); copy(s.join("\n"));
@operatino
operatino / MySQL_5-7_macOS.md
Last active Aug 3, 2021 — forked from nrollr/MySQL_macOS_Sierra.md
Install MySQL 5.7 on macOS using Homebrew
View MySQL_5-7_macOS.md

This is a fork of original gist https://gist.github.com/nrollr/3f57fc15ded7dddddcc4e82fe137b58e, with slight changes on pointing to 5.7 version branch, instead of 8 (latest default of MySQL in Hombrew).

Install MySQL 5.7 on macOS

This procedure explains how to install MySQL using Homebrew on macOS (Sierra 10.12 and up)

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.
@mattifestation
mattifestation / CIPolicyParser.ps1
Last active Aug 3, 2021
Functions to recover information from binary Windows Defender Application Control (WDAC) Code Integrity policies.
View CIPolicyParser.ps1
# Ensure System.Security assembly is loaded.
Add-Type -AssemblyName System.Security
function ConvertTo-CIPolicy {
<#
.SYNOPSIS
Converts a binary file that contains a Code Integrity policy into XML format.
Author: Matthew Graeber (@mattifestation)
@nberlette
nberlette / BmwSvg.jsx
Created May 25, 2021
BMW Logo SVG as a React Native Component.
View BmwSvg.jsx
import * as React from 'react';
import { Text, View, StyleSheet } from 'react-native';
import Svg, { SvgProps, Use, Symbol, G, Path } from "react-native-svg"
export default function BmwSvg(props: SvgProps) {
return (
<Svg style={styles.logo} width="80%" height="80%" focusable="false" {...props}>
<Use xmlnsXlink="http://www.w3.org/1999/xlink" xlinkHref="#icon-bmw-logo-gray">
<Symbol viewBox="0 0 340 340" id="icon-bmw-logo-gray" xmlns="http://www.w3.org/2000/svg">
<G fill="#6f6f6f">