Skip to content

Instantly share code, notes, and snippets.

View jtcressy's full-sized avatar

Joel Cressy jtcressy

View GitHub Profile
@jtcressy
jtcressy / gist:3d5243f9413a3518359f47c9db21973a
Created October 7, 2016 03:00
grepping fuck in the jedi academy repo
jtcressy@jtcressy-G46VW ~/githubrepos/Jedi-Academy [20:59:01]
> $ grep -r "fuck" * [±master ✓]
code/win32/win_glimp.cpp: // error box that'll only appear if something's seriously fucked then I'm going to fallback to
code/win32/win_qgl_dx8.cpp: // But I can't figure out who the fuck has a lock on the texture, or
code/server/sv_savegame.cpp: // I'm going to jump in front of a fucking bus if I ever have to do something so hacky in the future.
code/server/sv_savegame.cpp: // popup, but we need it to be up for at least a second, so sit here in a fucking
code/renderer/tr_WorldEffects.cpp:#define COUTSIDE_STRUCT_VERSION 1 // you MUST increase this any time you change any binary (fields) inside this class, or cahced files will fuck up
code/mp3code/mhead.c: return 0; // fuck
import java.util.*;
public class Santa {
private static int childCount = 100;
public static void main(String[] args) {
Child[] children = new Child[childCount];
for (int i = 0; i < childCount;i++){
children[i] = new Child();
}
public class Child {
public String name;
public boolean isSleeping;
public boolean isNice;
public Child() {
name = "None";
isSleeping = false;
isNice = true;
}
@jtcressy
jtcressy / codenvy_logs
Created January 31, 2017 15:10
Logs from codenvy/codenvy container
Waiting for Postgres to boot...
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+----------+----------+------------+------------+-----------------------
dbcodenvy | postgres | UTF8 | en_US.utf8 | en_US.utf8 |
postgres | postgres | UTF8 | en_US.utf8 | en_US.utf8 |
template0 | postgres | UTF8 | en_US.utf8 | en_US.utf8 | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | en_US.utf8 | en_US.utf8 | =c/postgres +
| | | | | postgres=CTc/postgres
@jtcressy
jtcressy / codenvy_admin_hack.sql
Last active February 7, 2017 06:10
Very hacky workaround to make more admin users in codenvy onprem
INSERT INTO systempermissions(userid,id) VALUES((SELECT id FROM account WHERE name = 'user'),'id');
INSERT INTO systempermissions_actions(systempermissions_id,actions) VALUES('id','manageSystem');
INSERT INTO systempermissions_actions(systempermissions_id,actions) VALUES('id','setPermissions');
INSERT INTO systempermissions_actions(systempermissions_id,actions) VALUES('id','manageUsers');
INSERT INTO systempermissions_actions(systempermissions_id,actions) VALUES('id','manageOrganizations');
@jtcressy
jtcressy / README.md
Last active February 21, 2017 06:51
Create new Git Repo using api key through bash scripting

Create a Remote Repository on GitHub using the GitHub API

Usage: $ ./create-github-repo.sh <REPO NAME> [private]

Required: Create this file: ~/.ssh/github_token and insert an API token from your github account into it.

You can go to https://github.com/settings/tokens to generate a new token

@jtcressy
jtcressy / snake.py
Last active November 26, 2022 03:45
Raspberry Pi SenseHat/Sense Emulator Snake Game
#!/usr/env/python3
"""
Snake.py by Joel Cressy
Run on a raspberry pi with attached senseHAT or python environment setup with a senseHAT emulator
"""
import asyncio
import time
from sense_hat import SenseHat
from sense_emu import SenseHat as SenseEmu
from signal import pause
@jtcressy
jtcressy / draclcdupdater.py
Created May 19, 2018 12:26
Dell PowerEdge LCD Updater (via ipmitool)
"""
Dell LCD Updater v0.1
Required Packages: python-ipmi
Also requires that ipmitool be installed on your system
Set the user-defined LCD text of most Dell PowerEdge servers generation 9 and above
Maximum string length is 14 characters
Requires that ipmi over lan be enabled in the DRAC of your server

Keybase proof

I hereby claim:

  • I am jtcressy on github.
  • I am jtcressy (https://keybase.io/jtcressy) on keybase.
  • I have a public key ASDH4GGAnyRdM2qhqb4A_fhyQU5AhiXnQIUNO2rzVdHkQgo

To claim this, I am signing this object:

@jtcressy
jtcressy / README.md
Last active November 26, 2022 03:45
Automatic Imgur HypeVote Machine

AUTO HYPE VOTE

Steps to activate:

  1. Copy the entire contents of autohypevote.js below into your browser's JS console (hit F12 then go to Console)
  2. In the same console, type autohypevote(10) to give 50 hype votes to the next 10 posts automatically (adjust numbers as needed)
  3. If you need to get off this hype train, type stopthehype() at any time to regain control of your browser

Usage: