Skip to content

Instantly share code, notes, and snippets.

View Cxarli's full-sized avatar
🔓
'; DROP TABLE bugs --

Charlie Cxarli

🔓
'; DROP TABLE bugs --
View GitHub Profile
// ==UserScript==
// @name Magister
// @namespace magister
// @description Tools for staying logged in on Magister
// @include https://*.magister.net/*
// @version 1.7.1
// @grant none
// ==/UserScript==
// Enter Magister username and password here
Error: spawn ENOTDIR
at exports._errnoException (util.js:837:11)
at ChildProcess.spawn (internal/child_process.js:298:11)
at Object.exports.spawn (child_process.js:351:9)
at Function.spawn (/home/charlie/.atom/packages/atom-beautify/node_modules/cross-spawn/node_modules/cross-spawn-async/index.js:13:18)
at spawn (/home/charlie/.atom/packages/atom-beautify/node_modules/cross-spawn/index.js:34:23)
at /home/charlie/.atom/packages/atom-beautify/src/beautifiers/beautifier.coffee:289:13
at tryCatcher (/home/charlie/.atom/packages/atom-beautify/node_modules/bluebird/js/main/util.js:26:23)
at Promise._resolveFromResolver (/home/charlie/.atom/packages/atom-beautify/node_modules/bluebird/js/main/promise.js:480:31)
at new Promise (/home/charlie/.atom/packages/atom-beautify/node_modules/bluebird/js/main/promise.js:70:37)
bool win = false;
if( ! win ) {
for(int n=0; n<=6; n+=3) {
if ( grid[n] == grid[n+1] && grid[n] == grid[n+2] ) {
win = true;
break;
}
}
}
@Cxarli
Cxarli / x.vbs
Created December 10, 2015 09:07
set wshshell = wscript.CreateObject("wScript.Shell")
wshshell.run "Notepad"
wscript.sleep 400
wshshell.sendkeys "T"
wscript.sleep 100
wshshell.sendkeys "h"
wscript.sleep 120
wshshell.sendkeys "i"
@Cxarli
Cxarli / Main.java
Created December 8, 2015 21:08
Histrogram
package xyz.mycharlie.colourhistogram;
import java.awt.*;
import java.awt.image.*;
import java.io.*;
import javax.imageio.*;
public class Main {
public int[][] createRGBData(BufferedImage img) {
int[] R=new int[256], G=new int[256], B=new int[256];
@Cxarli
Cxarli / atom-updater.sh
Created November 20, 2015 22:37
An updater for Atom.
#!/bin/bash
latest=`curl -i "https://github.com/atom/atom/releases/latest" 2>/dev/null | grep "Location: " | cut -d' ' -f2 `
downloadurl=`echo -n "$latest" | sed 's/tag/download/g' | sed 's/$/\/atom-amd64.deb/g' | tr -d '\r'`
version=`echo "$latest" | grep -Eo "v([0-9]+\.){1,}([0-9]+)"`
# Check if file exists
if [ -e .atom-version ]; then
curver=`cat .atom-version`
else
;; ---- HELP ----
;; Important functions:
;; syscall Call a system function. ID from `rax`, output to `rax`
;; - See: https://github.com/torvalds/linux/blob/097f70b3c4d84ffccca15195bdfde3a37c0a7c0f/include/linux/syscalls.h
;; - See: http://blog.rchapman.org/post/36801038863/linux-system-call-table-for-x86-64
;;
;; - Examples:
;; * 0 sys_read: Read a value
@Cxarli
Cxarli / hello.asm
Created October 28, 2015 20:51
hello.asm
;; ---- HELP ----
;; rax [64x] CPU cache — temporary register. `syscal` uses this
;; rdi [64x] CPU cache — 1st argument.
;; rsi [64x] CPU cache — 2nd argument.
;; rdx [64x] CPU cache — 3rd argument.
;; syscall [all] Call a system function. ID gotten from `rax`
;; - See: https://github.com/torvalds/linux/blob/097f70b3c4d84ffccca15195bdfde3a37c0a7c0f/include/linux/syscalls.h
cd git
git clone git@github.com:C-Bouthoorn/SpeedProgramming.git
cd ..
mkdir lighttpd
cp ./git/SpeedProgramming/lighttpd/* .
@Cxarli
Cxarli / CAPL.rb
Last active August 29, 2015 14:26 — forked from anonymous/CAPL.rb
CAPL v1.0
# Custom class for errorcodes
class ERR
def self.ERR; -1 end
def self.OK; 0 end
def self.EXIT; 1 end
def self.UNKNOWN; 2 end
def self.EMPTY_STACK; 3 end
def self.get x
case x