Skip to content

Instantly share code, notes, and snippets.

View nobane's full-sized avatar
🍔
github trained chatgpt on code without permission

nobane

🍔
github trained chatgpt on code without permission
View GitHub Profile
@nobane
nobane / Makefile
Created September 30, 2021 06:23
CS447/557 Cross-Platform Project1 Makefile
OBJ = ImageWidget.o ScriptHandler.o TargaImage.o
INCLUDE =
LIB =
LINK = -lfltk -lX11 -lXext
ifeq ($(OS),Windows_NT)
# Windows
INCLUDE = -I/p/graphics/local/packages/fltk-1.0.11/include\
-I/p/graphics/local/packages/libtarga/include
@nobane
nobane / main.cpp
Created April 11, 2021 15:18 — forked from nus/main.cpp
An example of emscripten with WebSocket.
// $ em++ -lwebsocket.js -o index.html main.cpp
#include <emscripten/emscripten.h>
#include <emscripten/websocket.h>
#include <stdio.h>
EM_BOOL onopen(int eventType, const EmscriptenWebSocketOpenEvent *websocketEvent, void *userData) {
puts("onopen");
EMSCRIPTEN_RESULT result;
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void print_bits(int i) {
// prints out the binary representation of a 32bit int
int mask = (1 << 1) - 1;
int bit = 0;
printf("0x%08X is\n", i);
// reverse loop pulling out one bit at a time
@nobane
nobane / bits.c
Last active January 16, 2020 05:36
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// prints out the binary representation of i
void print_bits(int i) {
int mask = (1 << 1) - 1;
int bit = 0;
printf("0x%08X is\n", i);
@nobane
nobane / sede_bot.py
Last active April 19, 2019 01:30
Automate running queries on SEDE because #aintnobodygottimeforthat
import time
import os
from datetime import datetime
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
@nobane
nobane / craigslist.user.js
Last active August 31, 2020 21:44
Post preview button
// ==UserScript==
// @name craigslist
// @namespace craigslist
// @include https://*.craigslist.org*
// @version 1
// @grant none
// ==/UserScript==
var popup = $('<div>').css({
height: 400,
@nobane
nobane / atom.less
Last active March 19, 2017 20:32
Styles for atom + sunburst theme
atom-text-editor,
atom-text-editor.editor,
atom-panel,
.tree-view,
.tab-bar {
font-family: 'Terminus (TTF)'!important;
-webkit-font-smoothing: none;
font-style: normal;
font-size: 12px;
}
@nobane
nobane / deshakify.sh
Last active September 10, 2016 07:20
deshakify: simple script interface to use ffmpeg/vidstab to smooth (deshake) videos.
#!/bin/bash
input=$1
trf=".$1.trf"
extension="${input##*.}"
filename="${input%.*}"
output="${filename}_deshaked.${extension}"
/usr/bin/ffmpeg -i $input -vf vidstabdetect=shakiness=10:accuracy=15:result="${trf}" -f null -
/usr/bin/ffmpeg -i $input -vf vidstabtransform=input="${trf}" $output
def my_compare_type(context, inspected_column,
metadata_column, inspected_type, metadata_type):
replace = dict(
VARCHAR='String',
BOOLEAN='Boolean',
DATETIME='DateTime',
INTEGER='Integer',
TEXT='Text'
)
pattern = re.compile( '|'.join(replace.keys()))
@nobane
nobane / sse.py
Last active August 29, 2015 14:18
#!/usr/bin/env python
import datetime
import flask
import json
import thread
import time
import uuid
from Queue import Queue