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
// Source code: | |
// | |
// int a = 25 | |
// int b = 20 | |
// int c = 0; | |
// | |
// if (a + b > 40) { | |
// c = 1; | |
// } else { | |
// c = 0; |
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 bytesInKilobyte = 1000 | |
const bytesInMegabyte = 1000000 | |
const bytesInGigabyte = 1000000000 | |
const bytesInTerabyte = 1000000000000 | |
function toHumanReadable(bytes) { | |
if (bytes >= bytesInTerabyte) return Math.round(bytes / bytesInTerabyte * 100) / 100 + " tb"; | |
if (bytes >= bytesInGigabyte) return Math.round(bytes / bytesInGigabyte * 100) / 100 + " gb"; | |
if (bytes >= bytesInMegabyte) return Math.round(bytes / bytesInMegabyte * 100) / 100 + " mb"; | |
if (bytes >= bytesInKilobyte) return Math.round(bytes / bytesInKilobyte * 100) / 100 + " kb"; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title></title> | |
<style media="screen"> | |
body * { | |
margin: 10px; | |
padding: 0; | |
display: block; |
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
Array.methods.sort = ->{ | |
let sorted = @copy() | |
let left | |
let right | |
@length().times(func(i) { | |
(@length() - 1).times(func(y) { | |
left = sorted[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
class Lexer { | |
property tokens | |
property source | |
property pos | |
property buffer | |
func constructor() { | |
@tokens = [] | |
@token = null | |
@source = "" |
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 leftpad = require('left-pad'); | |
const fs = require('fs'); | |
const chars = [ | |
[ | |
'┌─┐', | |
'│ │', | |
'│ │', | |
'│ │', | |
'└─┘', |
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 microsoft = function(name) { | |
const microsoft = (Math.random() < 0.5) ? 'microsoft ' : ''; | |
const smart = (Math.random() < 0.5) ? 'smart ' : ''; | |
const center = (Math.random() < 0.5) ? ' center' : ''; | |
const fullname = microsoft + smart + name + center; | |
return fullname.trim(); | |
} | |
module.exports = microsoft; |
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
$decrease: 4; | |
$initial: 28; | |
@for $i from 1 through 6 { | |
> h#{$i} { | |
// Formula: https://www.desmos.com/calculator/dhrvkbio8f | |
font-size: 1px * ($initial - (2 * $decrease)) + (pow($decrease, 2) / pow(2, $i)); | |
} | |
@if $i < 6 { | |
> h#{$i} + h#{$i+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
# Install git | |
sudo apt-get install git | |
sudo mkdir ~/github/ | |
# Uninstall all previous copies of vim | |
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-common vim-gui-common | |
sudo apt-get build-dep vim-gnome | |
sudo apt-get install python-dev libncurses5-dev | |
sudo rm -rf /usr/local/share/vim | |
sudo rm /usr/bin/vim |
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
export default function get(url, method, options, _callback) { | |
// Allow the options to be optional | |
if (typeof options == 'function') { | |
_callback = options; | |
options = {}; | |
} | |
// Wrap the _callback | |
const callback = function(err) { |
NewerOlder