THIS GIST WAS MOVED TO TERMSTANDARD/COLORS
REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
THIS GIST WAS MOVED TO TERMSTANDARD/COLORS
REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
var loopback = require('loopback'); | |
// HINT(s): | |
// Getting the app object: http://docs.strongloop.com/display/public/LB/Working+with+LoopBack+objects | |
// From a model script: http://docs.strongloop.com/display/public/LB/Working+with+LoopBack+objects#WorkingwithLoopBackobjects-Fromamodelscript | |
module.exports = function(StoreModel) { | |
StoreModel.prototype.instanceRemoteMethodSignature = function(cb) { | |
console.log('print this instance object: ', this); | |
cb(null); | |
}; |
/** | |
* Want to search github for sample code? | |
* Use the following `search criteria` in the github.com `search box` and then select `Code` from the search results: | |
* container upload remote language:javascript path:/common/models | |
*/ | |
module.exports = function(Container) { | |
Container.beforeRemote('**', function(ctx, unused, next) { | |
console.log('4: good'); | |
console.log('5: ctx.methodString', ctx.methodString); |
const Transaction = require('loopback-datasource-juggler'); | |
const update = async (ids, delta) => { | |
const result = []; | |
const tx = await models.MyModel.beginTransaction({ isolationLevel: Transaction.READ_COMMITTED }); | |
try { | |
for (const id of ids) { | |
const entity = await updateById(id, delta, { transaction: tx }); | |
result.push(entity); | |
} |
#!/bin/bash | |
# You'll need to have sox, pavucontrol and alsa-utils installed, and the snd_aloop kernel module loaded. | |
# You can configure your system to load it on startup or load it manually with "sudo modprobe snd_aloop" | |
# Once this is script is running, you need to start recording audio in the application of your | |
# preference, open pavucontrol, go to the recording tab and change the recording source of that application | |
# to "Monitor of Loopback ..." | |
time=5 |
/* | |
Arc Dark theme for styling Vimium link hints | |
By Giorgi Gzirishvili (@giogziro95). This code is in the public domain. | |
To use: | |
1. Copy the code. | |
2. Go to the Vimium options. | |
3. Click Show Advanced Options. |
It took me about 6 hours to find out all of this, but after reading a ton of man pages, initram scripts, and bug reports, I got a working result that takes about 2' to set up...
The point is to have a SWAP partition encrypted with LUKS, and it should be decypted during boot.
When using SysV, initram hooks and scripts in Debian worked like a charm but then, Systemd came and it's not yet fully implemented so this kind of crap happens. Systemd's cryptsetup doesn't support parameters in /etc/crypttab
so using a script there is ignored:
/* Options Debian's crypttab knows we don't:
The answer, honestly, is that the Romans had no fucking idea how to run a calendar.
Like, seriously, people notice "OCTOber" and "DECEMber" and say, "hey, those mean 'eight' and 'ten', but they're the 10th and 12th months, what's up with that?".
If you've got a little more history, you'll know that July and August are named after Julius and Augustus Caesar, and think, "oh, they added those two months and bumped the rest of the months back."
Now that Pebble servers are gone, some old components in the SDK need to be patched or replaced so they can fetch what they need from Rebble.
This script downloads and installes everything needed to build projects and also run the emulator.
Was tested on Ubuntu 18.04.2 on WSL.
Note: This gist may be outdated, thanks to all contributors in comments.
adb
is the Android CLI tool with which you can interact with your android device, from your PC
You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.
Don't hesitate to read comments, there is useful tips, thanks guys for this !