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
create or replace function add_on_update_trigger | |
(schema_name text, table_name text, column_name text) | |
returns void AS $body$ | |
declare | |
target_table text = | |
quote_ident(schema_name) || '.' || quote_ident(table_name); | |
trig_name text = | |
quote_ident( | |
'update_' || schema_name || '_' || table_name || '_' || column_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
/** | |
* we are going to upload file to s3 via node js by using | |
* aws-sdk - required | |
* busboy - required | |
* uuid - optional - for image renaming purpose | |
* with this library you can upload any kind of file to s3 via node js. | |
*/ | |
const AWS = require('aws-sdk'); | |
const UUID = require('uuid/v4'); |
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
/* | |
This middleware is to be used in the controller beforeAction hook. | |
You can search text, int and multi-column. | |
Example use in a controller: | |
query = ['search']; | |
beforeAction = [ | |
search(MyModel, { | |
searchText: ['description'], |
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
Result: 1 | |
Items { | |
TemplateId: "BADGE_BATTLE_ATTACK_WON" | |
Badge { | |
BadgeType: BADGE_BATTLE_ATTACK_WON | |
BadgeRanks: 4 | |
Targets: "\nd\350\007" | |
} | |
} | |
Items { |
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
var scales = { | |
'natural major': [0,2,4,5,7,9,11,12], | |
'ionian': [0,2,4,5,7,9,11,12], | |
'major': [0,2,4,5,7,9,11,12], | |
'chromatic': [0,1,2,3,4,5,6,7,8,9,10,11,12], | |
'spanish 8 tone': [0,1,3,4,5,6,8,10,12], | |
'flamenco': [0,1,3,4,5,7,8,10,12], | |
'symmetrical': [0,1,3,4,6,7,9,10,12], | |
'inverted diminished': [0,1,3,4,6,7,9,10,12], | |
'diminished': [0,2,3,5,6,8,9,11,12], |
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 bluetooth, time | |
import Adafruit_BBIO.GPIO as GPIO | |
search_time = 10 | |
led_pin = "P8_7" | |
# You can hardcode the desired device ID here as a string to skip the discovery stage | |
addr = None | |
print("Welcome to the Bluetooth Detection Demo! \nMake sure your desired Bluetooth-capable device is turned on and discoverable.") |
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 Ember from 'ember'; | |
export default Ember.Component.extend({ | |
theme: Ember.inject.service() | |
// ... | |
}); |
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 { Controller, action } from 'lux-framework'; | |
class UsersController extends Controller { | |
params = [ | |
'name', | |
'email', | |
'password' | |
]; | |
@action |
NewerOlder