Skip to content

Instantly share code, notes, and snippets.

View mitchellbusby's full-sized avatar

Mitchell Busby mitchellbusby

View GitHub Profile
var gulp = require('gulp');
var sass = require('gulp-sass');
gulp.task('sass', function() {
return gulp.src('./css/scss/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./css'));
});
gulp.task('sass:watch', function() {
  • google
  • suncorp
  • pwc - Anna / Florence said easy burnout from this company
  • rba
  • ernst & young
  • amex - not sure, haven't hired in the past two years
  • mi9
  • IBM - fast tracked for my year
  • IR - is highly ranked by The Australian for workplace culture
  • palantir
import fetch from 'isomorphic-fetch';
import { SUBMIT_IMAGE_PENDING } from '../constants';
export function submitImage() {
return {
type: SUBMIT_IMAGE_PENDING,
};
}
export function submitImageAsync(values, dispatch) {
import db from '../database';
class Item {
static fetch(user_id) {
return // make sure you return the promise so it can be seen by the outer method!
db.query("select * from items where user_id = $1", user_id)
.then(function (result) {
// This result object obvs comes from the $promise.resolve(result); that would happen within query.
// Lets pretend result is the string "Hello world"
console.log(result);
@mitchellbusby
mitchellbusby / gist:b95312f27ac78b4e1bbd
Created September 22, 2015 03:15
Auth service redirect for angular
.run(['$rootScope', '$location', 'AuthService', 'AUTH_EVENTS', function($rootScope, $location, AuthService, AUTH_EVENTS) {
// Redirect the user if they are not logged in
$rootScope.$on("$locationChangeStart", function(event, next, current){
if (!AuthService.isAuthenticated()) {
if (next.templateUrl!="views/login/login.html") {
$location.path("/login");
}
}
});
var numberOfSections = $('article > .section').length;
console.log(numberOfSections);
// define scrollToAnchor links
function scrollToAnchor(aId){
var aTag = $("a[name='"+ aId +"']");
$('html,body').animate({scrollTop: aTag.offset().top},'slow');
}
function clickScroller() {
scrollToAnchor("section-"+$(this).data('location'));
from PIL import Image
im = Image.open("person.jpg")
#im.rotate(45).show()
def blurMap(source, radius):
dest = source.copy()
img_map_flat = list(source.getdata())
width, height = source.size
img_map = [img_map_flat[i*width:(i+1)*width] for i in xrange(height)]
img_map_new = [img_map_flat[i*width:(i+1)*width] for i in xrange(height)]
@mitchellbusby
mitchellbusby / gist:5127779
Last active December 14, 2015 18:09
PygameWorkingyay
import pygame
from pygame.locals import *
import sys
import random
import math
#logic
class CircleThing(object):
def __init__(self, x, y, vx, vy, r, colour):
self.x = x
self.y = y
@mitchellbusby
mitchellbusby / gist:5127620
Created March 10, 2013 08:25
PygameAgain
import pygame
from pygame.locals import *
import sys
import random
import math
#logic
class CircleThing(object):
def __init__(self, x, y, vx, vy, r, colour):
self.x = x
self.y = y
import pygame
from pygame.locals import *
import sys
#logic
#end logic
pygame.init()
width = 640