Skip to content

Instantly share code, notes, and snippets.

View varjmes's full-sized avatar
🏳️‍🌈

James varjmes

🏳️‍🌈
View GitHub Profile
// Include gulp
var gulp = require("gulp");
// Include gulp plugins
var jshint = require("gulp-jshint");
var sass = require("gulp-sass");
// JS Lint Task
gulp.task("lint", function() {
return gulp.src("js/*.js")
Front-End London - https://www.youtube.com/playlist?list=PLOSHQ_hfikSoJ2tOfCheuiPcEcbSa7WpO
XOXO Fest - https://www.youtube.com/user/xoxofest
Generate - http://www.generateconf.com/videos
Lots of stuff from the jQuery Cons - https://www.youtube.com/channel/UCDT2QjewZ8DHsiaDXQFkxPg
Lots of stuff from JS Confs & CSS Conf EU - https://www.youtube.com/user/jsconfeu
Sass Conf 2013 - https://www.youtube.com/playlist?list=PLXrTmSPkhnXsd_MGL5Y__7IoRemarkRVi
Opera has modified script or content on www.youtube.com (PATCH-1185, youtube.com - show video above playlist). See browser.js for details
@varjmes
varjmes / humansize.py
Created December 28, 2014 12:48
humansize.py
SUFFIXES = {1000: ['KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
1024: ['KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']}
def approximate_size(size, a_kilobyte_is_1024_bytes=True):
"""Convert a file size to human-readable form.
Keyword arguments:
size -- file size in bytes
a_kilobyte_is_1024_bytes -- if True (default), use multiples of 1024,
if False, use multiples of 1000
@varjmes
varjmes / Testing.js
Created May 20, 2015 12:18
Testing!
console.log("Test!");

Keybase proof

I hereby claim:

  • I am charlotteis on github.
  • I am charlotteis (https://keybase.io/charlotteis) on keybase.
  • I have a public key whose fingerprint is 0DD4 948C 7BDF 5E30 38AD 57B1 4F43 DCA1 1236 8D47

To claim this, I am signing this object:

@varjmes
varjmes / theendingisalwaysdeath.rb
Last active December 18, 2015 00:09
Tiny text-based adventure game written in Ruby.
def prompt
print("> ")
end
puts("You enter a dark room with two doors. Do you go through door #1 or #2?")
prompt; door = gets.chomp
if door == "1"
puts("You walk towards door #1")
@varjmes
varjmes / gist:5694853
Created June 2, 2013 20:31
Tiny text-based adventure game I wrote in Ruby today. Spoilers: You die.
def prompt
print("> ")
end
puts("You enter a dark room with two doors. Do you go through door #1 or #2?")
prompt; door = gets.chomp
if door == "1"
puts("You walk towards door #1")
// Check if the player is ready to play!
confirm("Are you ready to begin?");
// How old is the player?
var age = prompt("How old are you?");
if (age < 18) {
console.log("Fine, you can play, but I'm not responsible for you.");
} else {
console.log("Let's go!");
@varjmes
varjmes / rockpaperscissors.js
Last active December 23, 2015 16:49
Rock, Paper, Scissors -> Is there a simpler way to do this?
var userChoice = prompt("Do you choose rock, paper or scissors?");
var computerChoice = Math.random();
if (computerChoice < 0.34) {
computerChoice = "rock";
} else if(computerChoice <= 0.67) {
computerChoice = "paper";
} else {
computerChoice = "scissors";
}