Skip to content

Instantly share code, notes, and snippets.

View Phrancis's full-sized avatar

Francis Veilleux-Gaboury Phrancis

View GitHub Profile
@Phrancis
Phrancis / Calculator.js
Created October 16, 2016 21:00
ReactJS Calculator draft
import React from 'react'
import {render} from 'react-dom'
import CalculatorComponent from '../components/CalculatorComponent'
// TODO make calculator logic
// See https://facebook.github.io/react/docs/reusable-components.html
class Calculator extends React.Component {
constructor(props) {
super(props)
USE Francis;
GO
IF OBJECT_ID('tempdb..#SieveOfEratosthenes') IS NOT NULL
DROP TABLE #SieveOfEratosthenes;
GO
CREATE TABLE #SieveOfEratosthenes (
Number BIGINT IDENTITY(2,1) PRIMARY KEY,
IsPrime BIT DEFAULT NULL
);
@Phrancis
Phrancis / code-review-comments-remote.json
Created June 16, 2016 03:33
code-review-comments-remote
callback([
{
"name":"[Q] Broken Code",
"description":"I'm afraid this question does not match what this site is about. $SITENAME$ is about improving existing, working code. $SITENAME$ is not the site to ask for help in fixing or changing <em>what</em> your code does. Once the code does what you want, we would love to help you do the same thing in a cleaner way! Please see our <a href=\"http://$SITEURL$/help/on-topic\">help center</a> for more information."
},
{
"name":"[Q] Question contains no code at all / a link to code",
"description":"Unfortunately your question is off-topic as of now, as the code to be reviewed must be <a href=\"http://meta.codereview.stackexchange.com/questions/1308\">present in the question.</a> Please add the code you want reviewed in your question. Thanks!"
},
{
@Phrancis
Phrancis / Chutes & Ladder results.txt
Last active June 15, 2016 16:41
SQL Chutes & Ladder results
Title
----------------
Chutes & Ladders
Table Id PropertyType Property Value
------------- ----------- -------------------- -------------------- --------------------
Game Settings 1 Game Start Timestamp Jun 15 2016 12:36PM
Game Settings 2 Game Setup Dice faces 6
Game Settings 3 Game Setup Number of players 2
Game Settings 4 Board Setup Board size 100
package Chapter6;
/**
* Try This 6-3: Quicksort is one of the best all-around sorting algorithms. The best implementations rely on recursion.
* The general principle is to select a value, called the "comparand", and then partition the array into 2 sections.
* All the values greater or equal to the partition value are put on one side, and those less than the value
* are put on the other side.
* This process is then repeated for each remaining section until the array is sorted.
*/
public class Quicksort {
@Phrancis
Phrancis / npm i console
Last active March 22, 2016 01:18
New npm install to try and fix a screw-up 2016-03-21 01:15 GMT
➜ javascript_sandbox git:(master) ✗ npm i
npm WARN package.json javascript_sandbox@0.0.1 No description
npm WARN package.json javascript_sandbox@0.0.1 No repository field.
npm WARN peerDependencies The peer dependency babel-core@^6.0.0 included from babel-loader will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
> spawn-sync@1.0.15 postinstall /Users/francisveilleux-gaboury/git/javascript_sandbox/node_modules/npm-install-webpack-plugin/node_modules/cross-spawn/node_modules/spawn-sync
> node postinstall
➜ javascript_sandbox npm i
npm WARN package.json react-example@0.0.1 No description
npm WARN package.json react-example@0.0.1 No repository field.
npm WARN package.json react-example@0.0.1 No README data
npm WARN peerDependencies The peer dependency babel-core@^6.0.0 included from babel-loader will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
> spawn-sync@1.0.15 postinstall /Users/francisveilleux-gaboury/git/javascript_sandbox/node_modules/npm-install-webpack-plugin/node_modules/cross-spawn/node_modules/spawn-sync
> node postinstall
@Phrancis
Phrancis / HackerRankPE34.js
Created March 18, 2016 10:47
HackerRankPE34.js
// HackerRank Project Euler #34: Digit factorials
// https://www.hackerrank.com/contests/projecteuler/challenges/euler034
function isStrictInt(input) {
// Confirms whether input is 1) of number type, 2) not equal to the NaN constant, and 3) can be parsed to an integer.
// Reference: http://stackoverflow.com/a/29658971/3626537
return typeof input === "number"
&& !isNaN(input)
&& parseInt(input) === input;
}
@Phrancis
Phrancis / polynomials-derivatives.clj
Created March 3, 2016 12:26
polynomials-derivatives.clj
; **********
; Here's an interesting use of both the `map` and `partial` functions. We'll define functions that use the `map` function
; to compute the value of an arbitrary polynomial and its derivative for given x values. The polynomials are described
; by a vector of their coefficients.
; Next, we'll define functions that use `partial` to define functions for a specific polynomial and its derivative.
; Finally, we'll demonstrate using the functions.
; The `range` function returns a lazy sequence of integers from an inclusive lower bound to an exclusive upper bound.
; The lower bound defaults to 0, the step size defaults to 1, and the upper bound defaults to infinity.
; **********
(defn- polynomial
@Phrancis
Phrancis / 3questions.md
Last active January 9, 2016 16:22
"3 questions" Code Review Help Desk Trial

####Phrancis:

This question could be suitable for Code Review, as long as (a) your code works as intended, (b) your code is real code, rather than example code, and (c) your code is included in the body of the question. If you wish for a peer review to improve all aspects of your code, please post it on Code Review. If you have any questions or concerns, join us at our CR Help Desk.

This question could be suitable for [Code Review](http://codereview.stackexchange.com/help), as long as (a) your code works as intended, (b) your code is real code, rather than example code, and (c) your code is included in the body of the question. If you wish for a peer review to improve all aspects of your code, please post it on Code Review. If you have any questions or concerns, join us at our [CR Help Desk](http://chat.stackexchange.com/rooms/34045).

####QPaysTaxes:

This question might be a good fit for [codereview.se], provided