Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Working from home

Noel Yahan noelyahan

:octocat:
Working from home
View GitHub Profile
@noelyahan
noelyahan / transitions_scale.pde
Created Apr 26, 2019
This processing sketch will provide a scale up down transition for rectangle and circle
View transitions_scale.pde
/**
* Scale
* by Denis Grutze.
*
* modified by Noel.
*
* Paramenters for the scale() function are values specified
* as decimal percentages. For example, the method call scale(2.0)
* will increase the dimension of the shape by 200 percent.
* Objects always scale from the origin.
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<canvas id="mycanvas"></canvas>
<script id="jsbin-javascript">
@noelyahan
noelyahan / generators.md
Created Jan 12, 2017 — forked from learncodeacademy/generators.md
What are Javascript Generators?
View generators.md

##what are generators##

  • They're pausable functions, pausable iterable functions, to be more precise
  • They're defined with the *
  • every time you yield a value, the function pauses until .next(modifiedYieldValue) is called
var myGen = function*() {
  var one = yield 1;
  var two = yield 2;
  var three = yield 3;
  console.log(one, two, three);
View tmux_cheatsheet.markdown

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

View openshift_docker_kub.sh
#!/bin/bash
# Preconditions
REQUIRED_DOCKER_VERSION=1.6
DOCKER_VERSION=`docker version | grep 'Server version' | cut -d ' ' -f 3`
if [[ "$DOCKER_VERSION" < "$REQUIRED_DOCKER_VERSION" ]]; then
echo "Docker ${REQUIRED_DOCKER_VERSION} is required to run Fabric8."
exit -1
fi
View application-template-jeebuild.json
{
"metadata": {
"name": "jee-sample"
},
"kind": "Template",
"apiVersion": "v1beta1",
"description": "This example shows how to create a simple jee application in openshift origin v3",
"parameters": [{
"name": "MYSQL_USER",
"description": "administrator username",
@noelyahan
noelyahan / cluster.md
Created Feb 10, 2016 — forked from learncodeacademy/cluster.md
Node Cluster - Enhance your node app by using all the cores of your processor.
View cluster.md

Here's all you have to do to add clustering to your node.js application.

  • save this code as cluster.js, and run cluster.js instead of server.js (or /bin/www, or whatever it's called for your project)
  • the only line you'll need to change is the last line - it needs to point to the location of your server.js file
var cluster = require('cluster');

if (cluster.isMaster) {
  // Count the machine's CPUs
  var cpuCount = require('os').cpus().length;
@noelyahan
noelyahan / RedisPythonPubSub1.py
Created Feb 7, 2016 — forked from jobliz/RedisPythonPubSub1.py
A short script exploring Redis pubsub functions in Python
View RedisPythonPubSub1.py
import redis
import threading
class Listener(threading.Thread):
def __init__(self, r, channels):
threading.Thread.__init__(self)
self.redis = r
self.pubsub = self.redis.pubsub()
self.pubsub.subscribe(channels)
View opencv_base64.cpp
#include <opencv2/opencv.hpp>
#include <vector>
#include <string>
using namespace std;
using namespace cv;
// Code from: http://www.adp-gmbh.ch/cpp/common/base64.html
static const std::string base64_chars =
View my_ocr.cpp
#include <stdio.h>
#include <iostream>
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/flann/miniflann.hpp"
#include <tesseract/baseapi.h>
using namespace cv;
using namespace std;
You can’t perform that action at this time.