I hereby claim:
- I am faulker on github.
- I am faulker (https://keybase.io/faulker) on keybase.
- I have a public key whose fingerprint is E109 0BC0 E464 5715 39EC DD9C 5756 1F0C D864 9D84
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| -- Delete all duplicate entries that match 'PARTITION BY' section and are 'completed' and 'finished_at' falls between timestamps | |
| DELETE FROM edge_scores AS a | |
| WHERE a.id IN ( | |
| SELECT id | |
| FROM ( | |
| SELECT | |
| id, | |
| ROW_NUMBER() | |
| OVER ( | |
| PARTITION BY user_id, assignment_id, finished_at::DATE, asset_id, score, completed |
| update tests_summary_data set data = (jsonb_set(to_jsonb(data), '{misc,gap,pa}', '-1', false))::json where data->'misc'->'gap'->>'pa' = '0'; |
| -- Checks to see if 'prealgebra' exists int he json array data->'series' | |
| SELECT * FROM table WHERE jsonb_exists(data -> 'series', 'prealgebra'); |
| function listenForSqlAndDisplay() | |
| { | |
| \DB::listen(function($sql, $bindings) | |
| { | |
| foreach ($bindings as $val) { | |
| $sql = preg_replace('/\?/', "'{$val}'", $sql, 1); | |
| } | |
| var_dump($sql); | |
| }); |
| function get_average($time_array) | |
| { | |
| $total = ""; | |
| $last = ""; | |
| $count = count($time_array); | |
| for($t=0;$t<$count;$t++) | |
| { | |
| $time = $time_array[$t]; | |
| if($t == 0) | |
| { |