var x = 5;
const name = 'Homer';
let homer = {
first: name,
last: 'Simpson'
};
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
'use strict'; | |
const crypto = require('crypto'); | |
const ENC_KEY = "bf3c199c2470cb477d907b1e0917c17b"; // set random encryption key | |
const IV = "5183666c72eec9e4"; // set random initialisation vector | |
// ENC_KEY and IV can be generated as crypto.randomBytes(32).toString('hex'); | |
const phrase = "who let the dogs out"; | |
var encrypt = ((val) => { |
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
cssStringToFileDownloader = function (cssString) { | |
var blob = new Blob([cssString], { type: 'text/css' }); | |
var el = document.createElement('a'); | |
el.download = 'cssPaletteBundle.css'; | |
el.href = URL.createObjectURL(blob); | |
el.dataset.downloadurl = ['text/css', el.download, el.href].join(':'); | |
el.style.display = 'none'; | |
document.body.appendChild(el); | |
el.click(); | |
document.body.removeChild(el); |
var foo = {'bar': 1};
function overwriteFoo(obj) {
obj = {'bar': 2};
}
function overwriteFooBar(obj) {
obj.bar = 2;
}
overwriteFoo(foo)
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 crypto = require('crypto'), | |
algo = 'aes-256-cbc', | |
key = 'super123secretKey!'; | |
function encrypt(text){ | |
var cipher = crypto.createCipher(algo,key) | |
var crypted = cipher.update(text,'utf8','hex') | |
crypted += cipher.final('hex'); | |
return crypted; | |
} |
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
$ git clone https://[email protected]/user/project_name.git | |
$ cd project_name | |
# create new respository in github eg. `cloned_project` | |
$ git remote add upstream [email protected]:user/cloned_project.git | |
$ git push upstream master | |
$ git push --tags upstream |
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 reactTriggerChange(e){var t,n,c,r,a,i,v,u,o,d,l=e.nodeName.toLowerCase(),p=e.type;function s(e,t){var n=Object.getOwnPropertyDescriptor(e,t);n&&n.configurable&&delete e[t]}function E(e){e.preventDefault(),r||(e.target.checked=!1),a&&(a.checked=!0)}"select"===l||"input"===l&&"file"===p?((t=document.createEvent("HTMLEvents")).initEvent("change",!0,!1),e.dispatchEvent(t)):"input"===l&&{color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0}[p]||"textarea"===l?(n=Object.getOwnPropertyDescriptor(e,"value"),(t=document.createEvent("UIEvents")).initEvent("focus",!1,!1),e.dispatchEvent(t),"range"===p?(v=(i=e).min,u=i.max,o=i.step,d=Number(i.value),i.min=d,i.max=d+1,i.step=1,i.value=d+1,s(i,"value"),i.min=v,i.max=u,i.step=o,i.value=d):(c=e.value,e.value=c+"#",s(e,"value"),e.value=c),(t=document.createEvent("HTMLEvents")).initEvent("propertychange",!1,!1),t.propertyName="value",e.dispatchEvent(t),(t=document.createEvent( |
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 { get, String, inject: { service } } = Ember; | |
export default Component.extend({ | |
store: inject.service(), | |
// Note: As we are using pushPayload to modify data directy in store, rollback won't be possible. | |
// Use https://github.com/offirgolan/ember-data-copyable to clone your model and restore if needed. | |
actions: { | |
// some action which get's triggered on some change which makes our model dirty. | |
someAction() { |
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
// Credits to the following posts that helps me to reduce build times drastically | |
// https://discuss.emberjs.com/t/tips-for-improving-build-time-of-large-apps/15008/12 | |
// https://www.gokatz.me/blog/how-we-cut-down-our-ember-build-time/ | |
//ember-cli-build.js | |
let EmberApp = require('ember-cli/lib/broccoli/ember-app'); | |
let env = EmberApp.env(), |
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
[ | |
{ | |
"id": "large_brown_square", | |
"name": "Large Brown Square", | |
"short_names": [ | |
"large_brown_square" | |
], | |
"colons": ":large_brown_square:", | |
"emoticons": [], | |
"unified": "1f7eb", |
OlderNewer