Skip to content

Instantly share code, notes, and snippets.

View kinsleykajiva's full-sized avatar
🏠
Working from home

Kinsley Kajiva kinsleykajiva

🏠
Working from home
  • Africa
  • 02:24 (UTC +02:00)
View GitHub Profile
@dflima
dflima / canvas.html
Created October 17, 2012 19:54
Drawing a line between two clicked points
<html>
<head>
<script type="text/javascript">
window.onload = function() {
var clicks = 0;
var lastClick = [0, 0];
var canvas = document.getElementById('exemploCanvas');
canvas.addEventListener('click', draw, false);
@gibbs
gibbs / currency_symbols.php
Last active April 3, 2024 10:09
An array of currency symbols as HTML entities
<?php
$currency_symbols = array(
'AED' => '&#1583;.&#1573;', // ?
'AFN' => '&#65;&#102;',
'ALL' => '&#76;&#101;&#107;',
'AMD' => '',
'ANG' => '&#402;',
'AOA' => '&#75;&#122;', // ?
'ARS' => '&#36;',
'AUD' => '&#36;',
@menzerath
menzerath / backup.php
Last active February 18, 2024 19:33
PHP: Recursively Backup Files & Folders to ZIP-File
<?php
/*
* PHP: Recursively Backup Files & Folders to ZIP-File
* MIT-License - 2012-2018 Marvin Menzerath
*/
// Make sure the script can handle large folders/files
ini_set('max_execution_time', 600);
ini_set('memory_limit', '1024M');
@mindplay-dk
mindplay-dk / README.md
Last active March 16, 2024 12:14
ISO 3166-2 Country and State/Region Tables for MySQL
@jewelsea
jewelsea / MyApplicationClass.java
Last active March 30, 2022 03:47
JavaFX TreeView item dynamic loading demo with FXML.
import javafx.animation.*;
import javafx.application.Application;
import javafx.event.*;
import javafx.fxml.FXMLLoader;
import javafx.scene.*;
import javafx.scene.image.Image;
import javafx.scene.input.MouseEvent;
import javafx.stage.*;
import javafx.util.Duration;
@psdtohtml5
psdtohtml5 / snippet.js
Created August 12, 2013 21:39
JavaScript : Scroll and Focus to Element (input)
var cursorFocus = function(elem) {
var x = window.scrollX, y = window.scrollY;
window.scrollTo(x, y);
elem.focus();
}
cursorFocus(document.getelementbyId('search-terms'));
@rnorth
rnorth / gist:7019921
Created October 17, 2013 06:23
Quick example of using Quasar channels. Must run using the Quasar JVM agent. https://github.com/puniverse/quasar/ Example output: 'Hello 1' -> 'Hello 2' -> 'Hello 3' -> 'Hello 4' -> 'Hello 5' -> 'Hello 6' -> 'Hello 7' -> 'Hello 8' -> -> 'Hello 1' 'Hello 9' -> -> 'Hello 2' 'Hello 10' -> -> 'Hello 3' 'Hello 11' -> -> 'Hello 4' 'Hello 12' -> -> 'He…
import co.paralleluniverse.fibers.Fiber;
import co.paralleluniverse.fibers.SuspendExecution;
import co.paralleluniverse.strands.SuspendableRunnable;
import co.paralleluniverse.strands.channels.Channel;
import co.paralleluniverse.strands.channels.Channels;
import jsr166e.ForkJoinPool;
import java.util.concurrent.ExecutionException;
import static java.lang.String.format;
@ijy
ijy / sublime-text-3-setup.md
Last active January 15, 2024 14:21
My Sublime Text 3 setup.

Sublime Text 3 Setup

Install Package Control

Install Package Control for easy package management.

  1. Open the console with Ctrl+`
  2. Paste in the following:
@bugabinga
bugabinga / AnimateNodeIn.java
Created March 16, 2014 00:53
JavaFX-Sample of how to animate Node in and out of Scene.
package application;
import java.util.function.Supplier;
import javafx.animation.Animation;
import javafx.animation.FadeTransition;
import javafx.animation.Interpolator;
import javafx.animation.RotateTransition;
import javafx.animation.ScaleTransition;
import javafx.application.Application;
@ComFreek
ComFreek / BufferedImageTranscoder.java
Last active April 9, 2024 16:59
JavaFX & Batik SVG Renderer: Minimal example
/**
* This is a compilation of code snippets required to render SVG files in JavaFX using Batik.
* See my full post on StackOverflow: http://stackoverflow.com/a/23894292/603003
*/
package proofofconcept;
import java.awt.image.BufferedImage;
import org.apache.batik.transcoder.TranscoderException;
import org.apache.batik.transcoder.TranscoderOutput;