Skip to content

Instantly share code, notes, and snippets.

View karloscarweber's full-sized avatar
📱
Building

Karl Weber karloscarweber

📱
Building
View GitHub Profile
//
// ViewController.swift
// Tetris
//
// Created by Julius Parishy on 11/19/14.
// Copyright (c) 2014 Julius Parishy. All rights reserved.
//
import UIKit
@JunaidQadirB
JunaidQadirB / Uploader.php
Created July 31, 2011 17:13
The Uploader class is a simple php script that makes file uploads a bit easier.
/**
*
* The Uploader class is a simple php script that makes file
* uploads a bit easier.
* @author Junaid Qadir Baloch (shekhanzai.baloch@gmail.com)
* @version 0.1 10:18 PM 7/30/2011
*
*/
class Uploader
{
@karloscarweber
karloscarweber / jquery.function.js
Created April 15, 2012 00:34
A Jquery Function Extention boilerplate
// Jquery Function BoilerPlate for newbies
//
//
// Surrounded by parentheses to allow anonymous founcitons on the inside
(function($){ // pass the jquery pseudo variable "$" into the function in order to create it's awesomeness.
$.fn.yourFucntion = function(userConfig) {
// please note, the "this" variable in the current scope will refer to the
@renaudbedard
renaudbedard / WaveformDisplay.cs
Created September 25, 2014 03:37
Waveform visualizer
using System;
using System.Collections;
using System.Threading;
using UnityEngine;
class WaveformDisplay : MonoBehaviour
{
public Tracker Tracker;
public int LineSegments;
@mattdesl
mattdesl / dither.js
Created June 14, 2018 20:14
dither-blob.js
const sketcher = require('canvas-sketch-tool'); // not yet public
// Import geometry & utilities
const createRegl = require('regl');
const createPrimitive = require('primitive-icosphere');
const createCamera = require('perspective-camera');
const glslify = require('glslify');
const hexRgb = require('hex-rgb');
// Utility to convert hex string to [ r, g, b] floats
@rakeshtembhurne
rakeshtembhurne / render_view_as_variable.php
Created July 19, 2013 10:10
CakePHP: Render view in a variable inside controlller
<?php
$view = new View($this, false);
$view->set(compact('some', 'vars'));
$html = $view->render('view_name');
@anandabits
anandabits / swift-responder-chain.swift
Last active March 1, 2022 23:45
A minimalist responder chain implemented in pure Swift
// Created by Matthew Johnson on 5/28/16.
// Copyright © 2016 Anandabits LLC. All rights reserved.
//
// This is a minimalist implementation of a responder chain in pure Swift.
//
// It is not intended to demonstrate the best way to
// implement event processing in Swift.
//
// The intent is to show how little code is necessary to acheive behavior
// similar to Cocoa's responder chain in pure Swift.
@calebd
calebd / ArrayHelpers.swift
Last active November 4, 2022 15:17
Swift Helpers
extension Array {
func first() -> Element? {
if isEmpty {
return nil
}
return self[0]
}
func last() -> Element? {
@awesome
awesome / jQuery-non-AJAX-POST.coffee
Created October 25, 2012 17:42
jQuery non-AJAX POST
# function submit(action, method, values) {
# var form = $('<form/>', {
# action: action,
# method: method
# });
# $.each(values, function() {
# form.append($('<input/>', {
# type: 'hidden',
# name: this.name,
# value: this.value