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
javascript:(function(){ | |
for(let radio of document.querySelectorAll("[id='radioX']")) { | |
radio.querySelectorAll('[type="radio"]')[0].checked = true | |
} | |
})(); |
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
filename = input('Input your filename: ') # .txt | |
file = open(filename, 'r') | |
output_file = open(filename+'_out', 'w') | |
lines = file.readlines() | |
for line in lines: | |
line=line.replace('\n', ' ') | |
output_file.write(line) |
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
for i in range(0, 3): | |
for j in range(i, 5): | |
print("*", end="") | |
print("\r") | |
for i in range(0, 4): | |
for j in range(0, i+1): | |
print("*", end="") | |
print("") |
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
import java.util.Stack; | |
public class Calculator { | |
public enum Operator{ADD, SUBTRACT, MULTIPLY, DIVIDE, BLANK} | |
public static void main(String[] args){ | |
String expression = "2-6-7*8/2+5"; | |
Calculator calc = new Calculator(); | |
System.out.println(calc.compute(expression)); |
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
# -*- coding: utf-8 -*- | |
""" | |
This script will delete all of the tweets in the specified account. | |
You may need to hit the "more" button on the bottom of your twitter profile | |
page every now and then as the script runs, this is due to a bug in twitter. | |
You will need to get a consumer key and consumer secret token to use this | |
script, you can do so by registering a twitter application at https://dev.twitter.com/apps | |
@requirements: Python 2.5+, Tweepy (http://pypi.python.org/pypi/tweepy/1.7.1) |
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
const duplicateCounter = function (array, item) { | |
let itemLookingFor = []; | |
const arrayCopy = [...array]; // ES6 way to clone or copy an array to new array | |
arrayCopy.sort() | |
for (let i = 0; i < arrayCopy.length; i++) { | |
if(arrayCopy[i] === item) itemLookingFor.push(arrayCopy[i]); | |
} | |
return itemLookingFor.length; | |
} |