Skip to content

Instantly share code, notes, and snippets.

View Kaoschuks's full-sized avatar

Favour Chukwuemeka Kaoschuks

View GitHub Profile
@Kaoschuks
Kaoschuks / wfc-simple-tiled.ts
Created September 28, 2023 20:02 — forked from joshuamorony/wfc-simple-tiled.ts
A TypeScript implementation based on Robert Heaton's "Even Simpler Tiled Model" of the Wave Function Collapse algorithm
type Tile = number;
type TileOrientation = 0 | 90 | 180 | 270;
export type TileMapping = Record<number, number>;
type Coordinates = [number, number];
enum DirectionKeys {
UP = 'UP',
DOWN = 'DOWN',
LEFT = 'LEFT',

Easy steps to implement social login with linkedin in Angular 7 (Angular 2+)

Note: The entire login process cannot be handled from client side, backend integration required for some steps (Explained at Step-3).

Step-1: Create your app in linkedin developer console

In order to start with linkedin login, we need to first create out app in linkedin.

Note: If you have already created your app, click on Go to My apps, select your app and then follow from step no 1.2

// Get measurements for a new flower to generate a prediction
// The first argument is the data, and the second is the shape.
const inputData = tf.tensor2d([[4.8, 3.0, 1.4, 0.1]], [1, 4]);
// Get the highest confidence prediction from our model
const result = model.predict(inputData);
const winner = irisClasses[result.argMax().dataSync()[0]];
// Display the winner
console.log(winner);
@Kaoschuks
Kaoschuks / app.js
Created February 25, 2017 12:20 — forked from jgoux/app.js
Ionic / AngularJS service wrapper for Web SQL API / SQLite-Cordova-Plugin
angular.module('myApp', ['ionic', 'myApp.services', 'myApp.controllers'])
.run(function(DB) {
DB.init();
});
@Kaoschuks
Kaoschuks / index.php
Created September 2, 2016 12:34 — forked from ziadoz/index.php
Simple PHP / jQuery CSRF Protection
<?php
// See: http://blog.ircmaxell.com/2013/02/preventing-csrf-attacks.html
// Start a session (which should use cookies over HTTP only).
session_start();
// Create a new CSRF token.
if (! isset($_SESSION['csrf_token'])) {
$_SESSION['csrf_token'] = base64_encode(openssl_random_pseudo_bytes(32));
}
@Kaoschuks
Kaoschuks / svgtest.html
Created August 29, 2016 02:52 — forked from bencates/svgtest.html
Draw a SVG hexagonal grid
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>SVG Test</title>
</head>
<body>
<svg id="s" version="1.1"
width="300" height="300"
xmlns="http://www.w3.org/2000/svg">
@Kaoschuks
Kaoschuks / ObjectListener.php
Created June 11, 2016 15:49 — forked from soyuka/ObjectListener.php
Streaming big json files the good way with php with https://github.com/salsify/jsonstreamingparser
<?php
/**
* This implementation allows to process an object at a specific level
* when it has been fully parsed
*/
class ObjectListener implements \JsonStreamingParser_Listener {
/** @var string Current key **/
private $_key;