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
$uids = db_select('users', 'u')->fields('u', array('uid'))->execute()->fetchAllAssoc('uid'); | |
foreach (array_keys($uids) as $uid) { | |
$u = user_load($uid); | |
print $u->name . ';' . user_pass_reset_url($u) . "\n"; | |
} |
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
$config = \Drupal\field\Entity\FieldStorageConfig::loadByName('node', 'field_presentation_file'); | |
$config->setSetting('uri_scheme', 'private'); | |
$config->save(); | |
kint($config->getSettings()); |
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
// poorman's reactive var | |
function pmrv() { | |
this.value = null; | |
this.callers = {}; | |
this.set = function(v) { | |
this.value = v; | |
Object.keys(this.callers).forEach(k => this.callers[k]()); | |
} | |
this.get = function() { | |
this.callers[arguments.callee.caller] = arguments.callee.caller; |
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
#define WIN32_LEAN_AND_MEAN | |
#include <stdlib.h> | |
#include <windows.h> | |
#pragma comment(lib, "USER32") | |
#pragma comment(linker, "/SUBSYSTEM:WINDOWS") | |
#define KEYDOWN(k) ((k) & 0x80) | |
// This is a **very** minimal hotcorner app, written in C. Maybe its not the |
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
#!/bin/bash | |
IP=$(nmcli dev show wlp4s0 | grep DNS | grep -o "\w*\.\w*\.\w*\.\w*" | head -n 1) | |
sed -i "s/--dns=\w*\.\w*\.\w*\.\w*/--dns=$IP/" /etc/systemd/system/docker.service | |
systemctl daemon-reload | |
systemctl restart docker |
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
let car; | |
let target; | |
let preview = []; | |
let speed = 0.01; | |
let error = Infinity; | |
let gen = 0; | |
let parent; | |
function setup() { |
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
let grid = []; | |
let target = []; | |
let CX = 200; | |
let CY = 200; | |
function setup() { | |
createCanvas(CX, CY); | |
for (let y = 0; y < 10; y++) { | |
let row1 = []; | |
let row2 = []; |
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
tests = [] | |
running = false | |
done = function() { | |
test = tests.shift() | |
if (test) test(done) | |
} | |
const it = function(name, test) { | |
tests.push(test) |
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
- Flush bootstrap cache (hooks) | |
drush ev "cache_clear_all('*', 'cache_bootstrap', TRUE)" | |
- change username & password | |
drush sqlq "UPDATE users SET name='admin' WHERE uid=1" | |
drush upwd admin --password="admin" | |
- Violent flush | |
drush sqlq 'truncate cache' |
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
const Action = (...args) => { | |
[name, effects = {}, conditions = {}, weight = 1] = args | |
return { name, effects, conditions, weight } | |
} | |
const Planner = (...args) => { | |
let actions = args |
OlderNewer