This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { render, Index, Show } from "solid-js/web"; | |
import { createSignal } from "solid-js"; | |
let inputName; | |
function Todos() { | |
const [todos, setTodos] = createSignal([]); | |
const handleSubmit = (e) => { | |
e.preventDefault(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// If the user isn't logged in, don't do anything, just return | |
if(!Auth::user()) { | |
return false; | |
} | |
$now = new DateTime(); | |
$last_activity = Auth::user()->last_activity; | |
$diff = ( date diff magic ) | |
// Or whatever value in whatever format is needed... like I said, pseudo code | |
$timeout = "40"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark' | |
a = [ | |
["Francis", "Chartrand", "email1@email.com"], | |
["Francis", "Chartrand", "email2@email.com"], | |
["Francis", "Chartrand", "email3@email.com"], | |
["Francis", "Chartrand", "email4@email.com"], | |
["Francis", "Chartrand", "email5@email.com"] | |
] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT * FROM members | |
ORDER BY CASE WHEN id = 23 THEN 1 ELSE 0 END DESC, first_name, `last_name` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark' | |
Benchmark.bm do |x| | |
x.report("+") { | |
5000000.times do |i| | |
s = "foo"+"bar" | |
end | |
} | |
x.report("#") { | |
5000000.times do |i| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function log ($selection) { | |
var $i; | |
for (i = 0; i < arguments.length; i++) { | |
console.log( | |
arguments[i].map(function (i, e) { | |
return $(e).attr('id') | |
}).sort() | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELETE test FROM test INNER JOIN | |
(SELECT min(id) minid, sport_id, adresse_id | |
FROM test | |
GROUP BY sport_id, adresse_id | |
having count(1) > 1) AS duplicates | |
ON (duplicates.sport_id = test.sport_id | |
AND duplicates.adresse_id = test.adresse_id | |
AND duplicates.minid <> test.id) |