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 fs = require('fs'); | |
const readline = require('readline'); | |
const NUMBERS = 3; | |
const readStream = fs.createReadStream('./input.txt'); | |
const readInterface = readline.createInterface({ | |
input: readStream, | |
}); |
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
FROM amazonlinux:2 | |
# general build stuff | |
RUN yum update -y \ | |
&& yum groupinstall -y "Development Tools" \ | |
&& yum install -y wget tar | |
# libvips needs libwebp 0.5 or later and the one on amazonlinux2 is 0.3.0, so | |
# we have to build it ourselves |
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
#!/usr/bin/env python | |
import sys, os, re | |
from subprocess import check_output | |
file_path = sys.argv[1] | |
# Get branch name | |
branch_name = check_output(['git', 'symbolic-ref', '--short', '-q', 'HEAD']).strip() | |
# Initialize prefix 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
'use strict'; | |
// Main App | |
angular.module('') | |
.config(function($stateProvider) { | |
$stateProvider | |
.state('dashboard', { | |
resolve: { |
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
<?php | |
$number = 256; | |
$arr = []; | |
while($number > 0) { | |
$arr[] = $number; | |
$number = $number >> 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
<?php | |
$value = 'deojeff'; | |
$array = [ | |
[ | |
'tourney_id' => 1, | |
'player_1' => 'xxx', | |
'player_2' => 'yyy', | |
'player_3' => 'ttt', |
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
window.onload = function() { alert(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
/** | |
* Get the smallest integer in an array. | |
* @param {Array} arr Array of numbers. | |
* @return {Integer} The smallest integer. | |
*/ | |
function getMinimum(arr) { | |
var minValue = Infinity; | |
if (arr instanceof Array) { | |
for (var i = 0; i < arr.length; i++) { |
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 shortArr = [1, 2, 3, 5, 4, 8, 7, 6]; | |
var longArr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 22, 24, 23, 28, 27, 26, 25, 24, 22]; | |
function reSortArray(arr) { | |
var limit = 20; | |
if (arr.length < limit) { | |
return arr.sort(); | |
} else { |
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
$(function() { | |
dropzoneBody.ondrop = function(e) { | |
e.stopPropagation(); | |
e.preventDefault(); | |
var self = this; | |
self.className = 'dropzone'; // adds the border placeholder | |
var file = e.dataTransfer.files[0]; | |
var reader = new FileReader(); | |
NewerOlder