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
List<String> animals = new ArrayList<>(); | |
// Adding new elements to the ArrayList | |
animals.add("Lion"); | |
animals.add("Tiger"); | |
animals.add("Cat"); | |
animals.add("Dog"); | |
animals.add("Cuy"); |
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
{ | |
"name": "jquerysnippets", | |
"displayName": "jQuery Code Snippets", | |
"description": "Over 130 jQuery Code Snippets", | |
"version": "0.0.1", | |
"publisher": "donjayamanne", | |
"license": "SEE LICENSE IN LICENSE or README.MD", | |
"homepage": "https://github.com/DonJayamanne/jquerysnippets/blob/master/README.md", | |
"icon": "images/icon.png", | |
"engines": { |
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
class User { | |
constructor(firstName, lastName, email) { | |
this.firstName = firstName; | |
this.lastName = lastName; | |
this.email = email; | |
} | |
print() { | |
console.group("Developer"); | |
console.warn("firstName: ", this.firstName); |
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
<?xml version="1.0" encoding="utf-8"?> | |
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<VideoView | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:id="@+id/video1"/> | |
</RelativeLayout> |
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
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context="com.tocame.carlosmontalvo.tocame.MainActivity"> | |
<com.tocame.carlosmontalvo.tocame.MultiTouch | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" |
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
#!/usr/bin/ruby | |
arreglo = [3,4,9,20, 8, 1, 7, 12, 15, 11, 5, 9, 6, 16, 10, 2] | |
def encontrar_numeros(numero, arreglo) | |
partes = arreglo.each_slice(4).to_a | |
encontrados = [] |
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
module Tokenable | |
extend ActiveSupport::Concern | |
included do | |
before_create :generate_token | |
scope :search_token, ->(token) { find_by(token: token, disable: false ) } | |
def to_param | |
token |
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
#I found the reset_pk_sequence! from this thread. http://www.ruby-forum.com/topic/64428 | |
#rails console | |
ActiveRecord::Base.connection.tables.each do |t| | |
ActiveRecord::Base.connection.reset_pk_sequence!(t) | |
end | |
#or ActiveRecord::Base.connection.tables.each { |t| ActiveRecord::Base.connection.reset_pk_sequence!(t) } |
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 get_user_json(utoken) | |
File.read("#{path_user_json}/#{utoken}.json") | |
end | |
def delete_user_json(utoken) | |
FileUtils.rm("#{path_user_json}/#{utoken}.json") | |
end | |
def empty_user_json(utoken) | |
begin |
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
//= require fonts |