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
@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 / 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"
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;
}
}
}
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)
// ==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
@Cxarli
Cxarli / atom-updater.sh
Created March 14, 2016 17:28
Atom Updater
#!/bin/bash
downloadurl=`curl -i "https://atom.io/download/deb" 2>/dev/null | grep "Location: " | cut -d' ' -f2 `
version=`echo "$downloadurl" | grep -Eo "v([0-9]+\.){1,}[0-9]+"`
# Check if file exists
if [ -e .atom-version ]; then
curver=`cat .atom-version`
else
curver="unknown"
@Cxarli
Cxarli / StringPlus.php
Created April 27, 2016 19:42
A PHP framework for making it easier to do common string functions
<?php
class StringPlus {
public $str = '';
public function __construct($string) {
// Convert booleans
if ( $string === true ) {
$this->str = "true";
} else if ($string === false) {
$this->str = "false";
@Cxarli
Cxarli / StringPlusTest.php
Last active April 27, 2016 19:43
A tester for StringPlus.php
<?php
include 'StringPlus.inc';
$string = new StringPlus("Hello World");
print strval($string) . "\n";
print "\n--- contains \n";
print new StringPlus($string->contains("o W")) . "\t[true]\n";
print new StringPlus($string->contains("o W", true)) . "\t[true]\n";
using System;
namespace Test {
class MainClass {
public static void Main(string[] args) {
Student charlie = new Student ("Charlie", 7);
charlie.WhoAreYou();
}
}
#include <iostream>
int main(void);
// Yes I know they have the same value, but the name is different
#define _UNDEF ( (uint32_t) ~0 )
#define _DONE ( (uint32_t) ~0 )