Skip to content

Instantly share code, notes, and snippets.

View goxr3plus's full-sized avatar
💎
💎 Creating Spicy Projects 💎

GOXR3PLUS STUDIO goxr3plus

💎
💎 Creating Spicy Projects 💎
View GitHub Profile
const copyToClipboard = (text) =>{
if (window.clipboardData && window.clipboardData.setData) {
// Internet Explorer-specific code path to prevent textarea being shown while dialog is visible.
return window.clipboardData.setData("Text", text);
}
else if (document.queryCommandSupported && document.queryCommandSupported("copy")) {
var textarea = document.createElement("textarea");
textarea.textContent = text;
textarea.style.position = "fixed"; // Prevent scrolling to bottom of page in Microsoft Edge.
@goxr3plus
goxr3plus / Anjelos Oracle SQL
Created April 1, 2019 19:27
Anjelo's Oracle SQL
--Drop every cancer table --Uncomment the below if you are sure the db tables exist
--DROP TABLE Instructor;
--DROP TABLE Subject_Area;
--DROP TABLE Courses;
--Create Instructor Table:
CREATE TABLE Instructor
( id number NOT NULL,
name varchar2(150) NOT NULL,
@goxr3plus
goxr3plus / Javascript Closures example
Last active March 7, 2019 09:50
Javascript Closures example
//-----------------------Closures ------------------------------//
function retirement(retirementAge) {
let a = " years until retirement";
return function(yearsOfBirth) {
let age = 2019 - yearsOfBirth;
console.log(retirementAge - age + a);
};
}
@goxr3plus
goxr3plus / Javascript Bind , Call , Apply examples
Last active March 7, 2019 09:51
Javascript Bind , Call , Apply examples
//-----------------------Bind , Call , Apply ------------------------------//
//Example 1
const john = {
name: "John",
age: 26,
job: "Teacher",
presentation: function(style, timeOfDay) {
if (style === "formal") {
console.log(
@goxr3plus
goxr3plus / Detect END OF LINE (EOL) in File with Java
Last active December 16, 2022 14:28
Detect END OF LINE (EOL) in File with Java
enum Eol
{
WINDOWS,
MAC,
LINUX
}
Reader r = new FileReader("file absolute path");
int i = -1;
Eol eol = null;
@goxr3plus
goxr3plus / Aggelos PythonProject
Last active November 8, 2018 14:48
Python Binary to Decimal , Python Decimal to Binary
``` PYTHON
#----------------Convert Binary to Decimal and check for validity----------------------
def isBinary(s):
try:
return set(s) <= set('01')
except ValueError:
return False