Skip to content

Instantly share code, notes, and snippets.

View bantic's full-sized avatar
💭
Status!

Cory Forsyth bantic

💭
Status!
View GitHub Profile
@bantic
bantic / controllers.application.js
Last active October 25, 2020 04:39
Ember Table Fixed Footer
import Ember from 'ember';
const alpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('');
function makeRows(count, colCount, text='') {
return Array(count).fill().map((v,i) => {
return Array(colCount).fill().map((v,j) => alpha[j]).reduce((obj, letter) => {
obj[letter] = `${letter} ${text} ${i}`;
return obj;
}, {});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
tree: [{
id: 0,
name: 'Root',
isExpanded: true,
isSelected: false,
isVisible: true,
import Ember from 'ember';
export default Ember.Controller.extend({
isHidden: true
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
// assume we have a hash function called "hash"
// this is the array of already-stored data
let data = [{
url: 'google.com',
salt: 'asdf1234',
hashed_pw: '134hsfdo'
}, {
url: 'cnn.com',
salt: '123489asdf',
The PHP code is looking for a query parameter with the name "get_param" and the value "Hello world!".
I believe you can do this by appending the following to the URL of this PHP script: `?get_param=Hello world!`.
If that doesn't work you may need to URL-encode the "Hello world!" (because normally spaces aren't allowed in query params — but I think if you type
this into your browser location bar it will do the conversion for you automatically).
The URL-encoded form can be found by using the JavaScript `encodeURIComponent` function, like so: `encodeURIComponent('Hello world!')`.
The value is "Hello%20world!".
Good luck!
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
[[package]]
name = "cfg-if"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "console_error_panic_hook"
version = "0.1.5"
@bantic
bantic / benchmark results.txt
Last active February 13, 2019 17:07
Pythagorean triple calculations with and without Rayon in Rust, with benchmarks
Running target/release/deps/my_benchmark-1e021f1c2b2dab07
find 840 without rayon time: [1.0903 us 1.0999 us 1.1105 us]
change: [-2.0415% -0.5086% +1.4270%] (p = 0.56 > 0.05)
No change in performance detected.
Found 8 outliers among 100 measurements (8.00%)
1 (1.00%) high mild
7 (7.00%) high severe
find 840 with rayon time: [60.429 us 60.908 us 61.477 us]
change: [-6.5691% -3.5264% -0.1220%] (p = 0.04 < 0.05)
use std::collections::HashSet;
pub fn find(sum: u32) -> HashSet<[u32; 3]> {
(2..(sum / 2))
.map(|a| {
let b_plus_c = sum - a;
let b_numerator = b_plus_c.pow(2) - a.pow(2);
let b_denominator = 2 * b_plus_c;
let b = b_numerator / b_denominator;