Skip to content

Instantly share code, notes, and snippets.

@rw3iss
rw3iss / addDejaDupIgnoreFiles.sh
Created Jan 25, 2021
Add .deja-dup-ignore file to all subdirectories matching a pattern
View addDejaDupIgnoreFiles.sh
# This will only add it to the first instance/depth of the matching ignoreFolder (ie. it won't add it to the sub-dependencies of any node_modules folder
startPath=/home/rw3iss/Sites
ignoreFolder=node_modules
find $startPath -mindepth 1 -maxdepth 5 -name "$ignoreFolder" -type d -not -regex ".*$ignoreFolder.*$ignoreFolder.*" | while read fname; do
echo "" > "$fname/.deja-dup-ignore"
echo "$fname/.deja-dup-ignore created."
done
@mikepruett3
mikepruett3 / shell-setup.ps1
Last active Dec 2, 2022
Packages to install via scoop, winget, choco, and other tools...
View shell-setup.ps1
<#
.SYNOPSIS
Script to Initialize my custom powershell setup.
.DESCRIPTION
Script uses scoop
.NOTES
**NOTE** Will configure the Execution Policy for the "CurrentUser" to Unrestricted.
Author: Mike Pruett
Date: October 18th, 2018
@33eyes
33eyes / commit_jupyter_notebooks_code_to_git_and_keep_output_locally.md
Last active Dec 2, 2022
How to commit jupyter notebooks without output to git while keeping the notebooks outputs intact locally
View commit_jupyter_notebooks_code_to_git_and_keep_output_locally.md
  1. Add a filter to git config by running the following command in bash inside the repo:
git config filter.strip-notebook-output.clean 'jupyter nbconvert --ClearOutputPreprocessor.enabled=True --to=notebook --stdin --stdout --log-level=ERROR'  
  1. Create a .gitattributes file inside the directory with the notebooks

  2. Add the following to that file:

*.ipynb filter=strip-notebook-output  
@CGArtPython
CGArtPython / hex_color_to_rgba.py
Last active Dec 2, 2022
A Blender Python script to convert HEX colors to Blender RGB; Video tutorial: https://www.youtube.com/watch?v=knc1CGBhJeU
View hex_color_to_rgba.py
# give Python access to Blender's functionality
import bpy
# extend Python's math functionality
import math
def hex_color_to_rgba(hex_color):
# remove the leading '#' symbol
hex_color = hex_color[1:]
@SK851831
SK851831 / txt.txt
Created Aug 27, 2016 — forked from wookiecooking/txt.txt
haha google dork searches
View txt.txt
intitle:index.of .bash_history
intitle:index.of .sh_history
intitle:”Index of” index.html.bak
intitle:”Index of” index.php.bak
intitle:”Index of” index.jsp.bak
intitle:”Index of” “.htpasswd” htpasswd.bak
inurl:backup intitle:index.of inurl:admin
“Index of /backup”
intitle:”Index of” index.html~
intitle:”Index of” index.php~
@StuPig
StuPig / clean_branch.sh
Created Nov 7, 2014
git分支清理脚本 script to clean git remote branches
View clean_branch.sh
#!/bin/bash
echo '***********************************';
echo '*';
echo -e '*\t分支清理';
echo '*';
echo '***********************************';
echo '';
# 切到主干分支develop,更新远程分支
@ines
ines / diff_strings.py
Created Aug 1, 2019
Print colored visual diff in Python
View diff_strings.py
import difflib
import wasabi
def diff_strings(a, b):
output = []
matcher = difflib.SequenceMatcher(None, a, b)
for opcode, a0, a1, b0, b1 in matcher.get_opcodes():
if opcode == "equal":
output.append(a[a0:a1])
elif opcode == "insert":
@meiqimichelle
meiqimichelle / USstates_avg_latLong
Created Dec 1, 2013
JSON of US states (full names) and their average lat/long
View USstates_avg_latLong
[
{
"state":"Alaska",
"latitude":61.3850,
"longitude":-152.2683
},
{
"state":"Alabama",
"latitude":32.7990,
"longitude":-86.8073
@brizandrew
brizandrew / README.md
Created Jul 28, 2017
How to use node.js build routines and npm packages in Django.
View README.md

Using Node.js With Django

When writing django apps it's easy to ignore the organization of your front end code. Often, these backend coders will just write a static js and css file, stick it in the static directory, and call it a day.

You can also build them as two completely independent parts. With a complex gulp build routine independent of the django app. But if you don't know gulp, node, or those kinds of systems it can be a daunting process to get started with.

Enter django-compressor-toolkit (the name doesn't quite roll off the tongue).

Setting Up Django-Compressor-Toolkit

Using django-compressor and django-compressor-toolkit you can write Javascript ES6 code with all its fancy import/export logic or style your pages with sass instead of css, and leave your deploy routine largely untouched.

@hyuki
hyuki / ChatWithChatGPT.md
Last active Dec 2, 2022
結城浩とChatGPTの対話
View ChatWithChatGPT.md

結城浩とChatGPTの対話

2022年12月2日

  • 「質問」は結城浩の文章です。
  • 「回答」はChatGPTの文章です。

質問

ChatGPTという対話するAIツールがあります。人間が質問を投げかけるとそれらしく対話して回答してくれるツールです。こういうツールに対してどんな質問を投げかけたらおもしろい対話になるでしょうかね。何かアイディアがあったら聞かせてください。具体的な質問を知りたいなあ。