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
def escape_csv(user_generated_string): | |
""" | |
CSV injection esacaping for Python. Excel treats a string as active content when it encounters a | |
"trigger" character at the start of the string. This method returns the string with | |
the triger character escaped. | |
""" | |
if user_generated_string[0] in ('@','+','-', '='): | |
user_generated_string = "'" + user_generated_string |
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.Controller.extend({ | |
publishable: true, | |
actions: { | |
publish() { | |
console.log('publish'); | |
} | |
} |
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
-- replace table_name with the name of your database table, e.g. users | |
-- replace data with the serialized field in the table, e.g. nicknames | |
-- output generates serialized data that decrypts to a Ruby array. | |
-- data with quotes, hyphens, or spaces will have issues with this query. | |
-- preview the YAML to JSON to confirm the conversion is working. | |
SELECT data, REPLACE(REPLACE(REPLACE(REPLACE(REGEXP_REPLACE(REPLACE(REPLACE(REPLACE(data, | |
' ', ''), | |
'...', ''), | |
'---', '["'), |
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.Controller.extend({ | |
appName: 'Ember Twiddle', | |
actions: { | |
toggle() { | |
this.toggleProperty('isIn'); | |
} | |
} |