Skip to content

Instantly share code, notes, and snippets.

View gamingrobot's full-sized avatar
🤖
Doing Stuff

Morgan Creekmore gamingrobot

🤖
Doing Stuff
View GitHub Profile
@stormwild
stormwild / disable-constraints-t-sql.sql
Last active February 16, 2023 19:10
Temporarily disable constraints on a table T-SQL, SQL Server
-- http://www.blackwasp.co.uk/SQLDisableConstraints.aspx
ALTER TABLE TableName NOCHECK CONSTRAINT ALL
ALTER TABLE TableName CHECK CONSTRAINT ALL
ALTER TABLE TableName NOCHECK CONSTRAINT FK_Table_RefTable
ALTER TABLE TableName CHECK CONSTRAINT FK_Table_RefTable
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\Slight]
"Colour0"="240,240,240"
"Colour1"="255,255,255"
"Colour2"="63,63,65"
"Colour3"="103,103,103"
"Colour4"="0,0,0"
"Colour5"="0,255,0"
"Colour6"="21,23,26"
@azam
azam / svg2ico.sh
Last active February 24, 2025 11:46
Convert SVG to ICO using ImageMagick, with transparent background and multi-size icons
convert -density 256x256 -background transparent favicon.svg -define icon:auto-resize -colors 256 favicon.ico
@leonjza
leonjza / netcat.py
Last active September 19, 2024 23:56
Python Netcat
import socket
class Netcat:
""" Python 'netcat like' module """
def __init__(self, ip, port):
self.buff = ""
self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
@bonzanini
bonzanini / sentiment_classification.py
Last active October 30, 2020 23:58
Sentiment analysis with scikit-learn
# You need to install scikit-learn:
# sudo pip install scikit-learn
#
# Dataset: Polarity dataset v2.0
# http://www.cs.cornell.edu/people/pabo/movie-review-data/
#
# Full discussion:
# https://marcobonzanini.wordpress.com/2015/01/19/sentiment-analysis-with-python-and-scikit-learn
@makeittotop
makeittotop / oom-killer-explanation.gist
Last active November 8, 2024 17:00
Excellent discussion on OOM-Killer
Out of Memory (OOM) refers to a computing state where all available memory, including swap space, has been allocated.
Normally this will cause the system to panic and stop functioning as expected.
There is a switch that controls OOM behavior in /proc/sys/vm/panic_on_oom.
When set to 1 the kernel will panic on OOM.
A setting of 0 instructs the kernel to call a function named oom_killer on an OOM.
Usually, oom_killer can kill rogue processes and the system will survive.
The easiest way to change this is to echo the new value to /proc/sys/vm/panic_on_oom.
# cat /proc/sys/vm/panic_on_oom 1
@dannguyen
dannguyen / catdrawer-youtube-to-gif-README.md
Last active September 6, 2024 12:22
Using youtube-dl and gifify from the command-line to make a cat gif
@karpathy
karpathy / min-char-rnn.py
Last active May 12, 2025 17:28
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@rom1504
rom1504 / mcprotos_list.md
Last active May 31, 2017 08:44
List of files representing the minecraft protocol
@neutrino84
neutrino84 / PlanetShader.frag
Last active June 17, 2022 20:45
GLSL Planet Shader
precision lowp float;
uniform sampler2D channel0;
uniform float time;
varying vec2 vTextureCoord;
// rendering params
const float sphsize = 0.8; // planet size
const float dist = 0.08; // distance for glow and distortion