Skip to content

Instantly share code, notes, and snippets.

View dudeinthemoon42's full-sized avatar

Bobby Barjasteh dudeinthemoon42

View GitHub Profile
@ZacSweers
ZacSweers / crashcourse.md
Last active July 10, 2022 02:14
Python Reddit bot on Heroku

A crash course in setting up your Python Reddit bot on Heroku

You'll need to do the following:

  • You need to make your bot a python app. Do this by making another directory (can be the same name as the regular one) and put all your python code in that, and make an empty file called __init__.py in it as well. See how I structured mine if this isn't clear. In your base directory, create two files: "requirements.txt" and "runtime.txt". The requirements.txt file should be the output of pip freeze (you can run the command "pip freeze > requirements.txt"). If you're not using virtualenv, you'll need to go through after and delete all the lines with packages your code doesn't actually use. Check out mine to see what I mean. Runtime.txt just specifies with python version for heroku to use. Mine just has the line "python-2.7.4" in it. All of this will tell heroku to recognize your bot as a python app.

  • Make a heroku account and

@XVilka
XVilka / TrueColour.md
Last active October 9, 2025 17:55
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@kurtfunai
kurtfunai / README.md
Last active December 27, 2015 10:39 — forked from nickbudi/README.md

Kurts's CS:GO Config (Forked from Afterlife budi's)

This is my constantly updated CS:GO autoexec config.

Put the file autoexec.cfg in ...\Steam\steamapps\common\Counter-Strike Global Offensive\csgo\cfg or take what you want from it and add to your autoexec config!

Launch Options

-novid -noborder -high -threads 4 -freq 144 -refresh 144 +exec autoexec.cfg +mat_vignette_enable 0 -processheap
@ScottLilly
ScottLilly / InventorySystem.cs
Created October 11, 2013 18:40
C# code for inventory system that has a limited number of slots, and the ability to stack some items (with a different maximum size stack for different items).
using System;
using System.Collections.Generic;
using System.Linq;
namespace BusinessObjects.RedditRPGQuestion
{
public class InventorySystem
{
private const int MAXIMUM_SPACES_IN_INVENTORY = 10;
obj-m += rootkit.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
@jvns
jvns / broken-stack-code.c
Created October 1, 2013 01:39
Do a weird thing with the stack in C
#include <stdio.h>
void set_strings(char*** strings) {
char* strs[] = {"banana"};
*strings = strs;
}
int main() {
char** strings;
set_strings(&strings);
@pebreo
pebreo / ngram.py
Last active July 28, 2018 21:02
An n-gram generator in Python (newbie program)
from collections import Counter
from random import choice
import re
class Cup:
""" A class defining a cup that will hold the words that we will pull out """
def __init__(self):
self.next_word = Counter() # will keep track of how many times a word appears in a cup
@mgechev
mgechev / binary-search-tree-cpp.cpp
Last active October 3, 2022 03:54
Simple implementation of binary search tree in C++.
#include <iostream>
#include <math.h>
using namespace std;
template <class T>
struct Node {
T value;
Node *left;
Node *right;
@parse
parse / matrixmult.c
Created January 28, 2013 13:18
Simple matrix multiplication
#include <stdio.h>
typedef struct {
int nrows, ncols;
float *data;
} matrix_t;
float constC(int i, int j, matrix_t A, matrix_t B) {
int k;
float res = 0.0;
@nickbudi
nickbudi / README.md
Last active August 15, 2024 19:54
Budi's Counter-Strike: Global Offensive config

Budi's CS:GO Config

This is my constantly updated CS:GO autoexec config. Changelogs can be found under revisions here

Put autoexec.cfg in ...\Steam\steamapps\common\Counter-Strike Global Offensive\csgo\cfg or take what you want from it and add to your autoexec config!

After the Wild West Simulator 2015 update, video.txt needs to be put in ...\Steam\userdata\<Steam3 ID>\730\local\cfg

Launch Options