Skip to content

Instantly share code, notes, and snippets.

View mudream4869's full-sized avatar
📚
Mukyu Learning

神楽坂帕琪 mudream4869

📚
Mukyu Learning
View GitHub Profile
@mudream4869
mudream4869 / sg.md
Last active August 29, 2015 13:57
小遊戲
@mudream4869
mudream4869 / fixed-win.cpp
Last active August 29, 2015 13:57
fixed-win
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB);
glutInitWindowSize(600,600);
glutInitWindowPosition(80,80);
int gMainHandle;
gMainHandle = glutCreateWindow("QAQ");
glutSetWindow(gMainHandle);
HWND hwnd = FindWindow(NULL,"QAQ");
if( hwnd )
{
LONG style;
@mudream4869
mudream4869 / rubyindent.cpp
Last active August 29, 2015 13:58
ruby indent
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
char uppre[10][10] = {"module","class","def","if","else","unless","for","when","case","do"};
const int UP_MAX = 10;
char downpre[3][10] = {"end","else","when"};
const int DOWN_MAX = 3 ;
bool isdown(char *str)
{
if((str[0] == '#') or (str[1] == '#')) return false;
import pygame
from pygame.locals import *
def main():
pygame.init()
pygame.font.init()
screen = pygame.display.set_mode((600, 600), 0, 32)
pygame.display.set_caption("Hello world")
@mudream4869
mudream4869 / mpatest.cpp
Created May 28, 2014 10:35
range in map
#include<map>
#include<cstdio>
#include<cstdlib>
typedef std::map<int, int> mic;
typedef std::map<int, int>::iterator itmic;
int main(){
mic mmap;
itmic it;
for(int lx = 0;lx < 100000;lx++)
@mudream4869
mudream4869 / altest1.cpp
Last active August 29, 2015 14:13
al load wav + play
#include <OpenAL/al.h>
#include <OpenAL/alc.h>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <cstring>
#define NUM_BUFFERS 2
#define NUM_SOURCES 2
#define NUM_ENVIRONMENTS 2
@mudream4869
mudream4869 / haflag.sty
Created March 20, 2015 03:53
HonorAlgebra-Flag
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{haflag}[2015/03/22 HAFlag Package]
\usepackage{tikz}
\newcommand{\haflag}[1]{% text
\begin{tikzpicture}[scale=0.1,rotate=-10,shift={(-15, 0)},overlay,remember picture]
\draw[fill=black, thick] (0,0) -- ++ (0,8) arc (180:0:0.4 and 0.1) -- ++ (0,-8) arc (360:180:0.4 and 0.1);
\draw[thick] (0,8) arc (180:360:0.4 and 0.1);
\draw[fill=white,thick] (0.8,7.5) to[out=-30,in=210] ++(3,0) to[out=30,in=150] ++ (3,0) -- ++ (0,-4.5) to [out=150,in=30] ++(-3,0) to[out=210,in=-30] ++(-3,0) -- cycle;
import tornado.ioloop
import tornado.web
@tornado.gen.coroutine
def getstr():
raise tornado.gen.Return("Hello coroutine")
class MainHandler(tornado.web.RequestHandler):
@tornado.gen.coroutine
def get(self):
@mudream4869
mudream4869 / summary.py
Created August 9, 2015 11:32
期末廢文大賽記分板
import requests
import time
import random
import json
import sys
access_token = "access_token=[APP的Token]"
base_url = "https://graph.facebook.com/v2.3/"
@mudream4869
mudream4869 / vue-jscolor.js
Last active July 25, 2018 11:37
vue-jscolor
Vue.component('jscolor', {
template: '<input v-model="value" class="jscolor"/>',
props : ['value'],
mounted : function(){
window.jscolor.installByClassName('jscolor');
this.$el.jscolor.fromString(this.value);
$(this.$el).on('change', function(_this){
return function(){
_this.$emit('input', this.value);
}