Skip to content

Instantly share code, notes, and snippets.

// ==UserScript==
// @name dAmnGoodies
// @description Novelty features for dAmn chat.
// @author Sam Mulqueen <sammulqueen.nz@gmail.com>
// @version 3.3.1
// @include https://chat.deviantart.com/chat/*
// @grant GM_xmlhttpRequest
// ==/UserScript==
function dAmnGoodies_Script(){
@Trezoid
Trezoid / one_line_fizzbuzz
Created May 12, 2015 09:29
A single line fizzbuzz
for(var i = 1; i <= 100; i++){console.log((i%3 == 0 ? "fizz" : "") + (i%5 == 0 ? "buzz" : "") + ((i%3 != 0 && i%5 != 0) ? i : ""));}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
,gggg,
d8" "8I ,dPYb, ,dPYb,
88 ,dP IP'`Yb IP'`Yb
8888888P" I8 8I I8 8I
88 I8 8' I8 8'
88 ,gggg,gg I8 dP I8 dP gg gg
,aa,_88 dP" "Y8I I8dP I8dP I8 8I
dP" "88P i8' ,8I I8P I8P I8, ,8I
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <GLUT/glut.h>
#include "utility.h"
#include "glUtils.h"
#include "Bitmap.h"
.posts header img{
width: auto!important;
max-width: 100%!important;
margin: 0 auto!important;
display:block!important;
}
.posts header{
width: auto!important;
margin: 0!important;
10 * [09:16:31.319] Error: WebGL: getUniformLocation: program: null object passed as argument @ https://www.shadertoy.com/js/effect.js:751
[09:16:31.319] Error: WebGL: vertexAttribPointer: index -1 is invalid. That probably comes from a getAttribLocation() call, where this return value -1 means that the passed name didn't correspond to an active attribute in the specified program. @ https://www.shadertoy.com/js/effect.js:773
[09:16:31.319] Error: WebGL: enableVertexAttribArray: index -1 is invalid. That probably comes from a getAttribLocation() call, where this return value -1 means that the passed name didn't correspond to an active attribute in the specified program. @ https://www.shadertoy.com/js/effect.js:774
[09:16:31.319] Error: WebGL: disableVertexAttribArray: index -1 is invalid. That probably comes from a getAttribLocation() call, where this return value -1 means that the passed name didn't correspond to an active attribute in the specified program. @ https://www.shadertoy.com/js/effect.js:906
/* this works */
$.ajax({
url: '/upload/' + entID + '/photo',
type: 'POST',
beforeSend: function(xhr) {
xhr.setRequestHeader('X-CSRFToken', document.getElementsByName('csrfmiddlewaretoken')[0].value);
},
xhr: function() {
var req = $.ajaxSettings.xhr();
req.upload.addEventListener('progress', function(data) {
@Trezoid
Trezoid / gist:3930642
Created October 22, 2012 09:32
Accumulator
private void SetupAccumulators()
{
//Throttle Accumulator
ThrottleAccum = new FuzzyCollection("Throttle Output", null)
{
new FuzzySet("ThrottleOutput", 0, 100)
};
ThrottleAccum["ThrottleOutput"].SetRangeWithPoints(0, 100);
@Trezoid
Trezoid / gist:2992960
Created June 26, 2012 02:52
Currently Playing LSL script
/*******************
* Last.fm recently played script.
* Apply to an object to get a floating "recently played" floating above it.
*
* Written by Trezoid
*
* Only change the LFMuser variable to your last.fm username.
*********************/
string LFMuser = "trezoid"; //Last.fm Username. change this!
@Trezoid
Trezoid / black.java
Created April 24, 2012 12:40
A relatively simple game of 21 designed to show a new programmer how a simple java program works and interacts
/*
* loading the standard java libraries for various things
*/
import java.util.Random;//random number generator
import java.util.ArrayList;//Array lists
import java.util.Scanner;//Input, either from a file or user input.
import java.util.Calendar; //dates and times.
public class black {