This file contains hidden or 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
| -- A text input for reversing text. Very useful! | |
| -- | |
| -- Read how it works: | |
| -- https://guide.elm-lang.org/architecture/text_fields.html | |
| -- | |
| import Browser | |
| import Html exposing (Html, Attribute, div, input, text) | |
| import Html.Attributes exposing (..) | |
| import Html.Events exposing (onInput) |
This file contains hidden or 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
| describe('built-in matchers', function() { | |
| describe('toBeTruthy', function() { | |
| it('passes if subject is true', function() { | |
| expect(true).toBeTruthy(); | |
| expect(false).not.toBeTruthy(); | |
| }); | |
| }); | |
| describe('toBeFalsy', function() { | |
| it('passes if subject is false', function() { |
This file contains hidden or 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
| exports.getName = function(name) { | |
| return name; | |
| } |
This file contains hidden or 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 a new branch | |
| git checkout -b branch-name | |
| # checkout an existing branch | |
| git checkout branch name | |
| # pull changes from branch-a into current-branch | |
| git checkout branch-a | |
| git pull --rebase # get all the latest changes from branch-a | |
| git checkout current-branch |
This file contains hidden or 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
| require.config({ | |
| deps: ['app'], //just make your app file a dependency | |
| paths: { | |
| //... | |
| } | |
| }); |
This file contains hidden or 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 copy = db.collection.findOne({_id : ObjectId("552c0709d07e391454f649df")},{_id:0}); | |
| for (var i = 0; i< 10; i++){ | |
| db.collection.insert(copy); | |
| } |
This file contains hidden or 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 cursor = db.collection.find(url: /http/) | |
| while (cursor.hasNext()) { | |
| var x = cursor.next(); | |
| print("Before: "+x['url']); | |
| x['url'] = x['url'].replace('http', 'https'); | |
| print("After: "+x['url']); | |
| db.collection.update({_id : x._id}, x); | |
| } |
This file contains hidden or 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
| //return a collection of items | |
| public static Result getAssets() { | |
| List<Asset> asset = Ebean.find(Asset.class) | |
| .findList(); | |
| return ok(toJson(asset)); | |
| } | |
| //or return a single item with the id being passed as a url param | |
| public static Result getAsset(Integer id) { |
This file contains hidden or 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
| public class EntityList extends Model { | |
| @Id | |
| private Integer id; | |
| @Constraints.Required | |
| public String title; | |
| @Constraints.Required | |
| public String type; |
NewerOlder