Skip to content

Instantly share code, notes, and snippets.

@hiun
hiun / omega.js
Created June 27, 2017 18:37 — forked from CrossEye/omega.js
Functional compostion using fake operator overloading
// Based on a discussion with Michael Haufe:
// https://groups.google.com/group/jsmentors/browse_thread/thread/d028fb0041f93a27
// Not really recommended for anything but the fun of knowing it can be done!
var omega = function() {
var queue = [];
var valueOf = Function.prototype.valueOf;
Function.prototype.valueOf = function() {
queue.push(this);
return 1; // not needed now, but could be used later to distinguish operators.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script>
/*! jQuery v2.2.4 | (c) jQuery Foundation | jquery.org/license */
!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="2.2.4",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each
#include<stdio.h>
#include<stdlib.h>
int main(void)
{
int x;
int store[10];
int remain;
int z=0;
int i;
bool finish = false;
// c.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <stdlib.h>
int _tmain(int argc, _TCHAR* argv[])
{
int i;int math[40];
// while.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
int _tmain(int argc, _TCHAR* argv[])
{
/*
while(a<10) {
@hiun
hiun / namer.html
Created January 13, 2014 09:41
namer demo version 0.1
<!DOCTYPE html>
<html>
<body>
<script>
/*
var cars=["BMW","Volvo","Saab","Ford"];
for (var i=0;i<cars.length;i++)
{
document.write(cars[i] + "<br>");
}
@hiun
hiun / pre_sejong3-2.c
Created January 13, 2014 06:59
simple upperer
#include <stdio.h>
int main(void)
{
char a;
printf("------------ uppercase -------------\n");
printf("------- jan 13 2014 hiun kim -------\n\n");
printf("type latter want to display uppercase : ");
@hiun
hiun / pre_sejong3-1.cpp
Last active January 3, 2016 02:18
simple comparator
#include <stdafx.h>
#include <stdio.h>
int main(void)
{
int a, b, c;
printf("---------- c++ comparator ----------\n");
printf("------- jan 13 2014 hiun kim -------\n\n");
printf("type 3 number : ");
@hiun
hiun / pre_sejong3.cpp
Created January 13, 2014 02:50
if else if else example
// spring.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <stdio.h>
int main(void)
{
@hiun
hiun / pre_sejong2-1.cpp
Last active January 2, 2016 16:39
simple calc 2 fixed
// clac.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <stdio.h>
int main(void)
{
int sum, multiplying, subtraction, division;
int num, num2;