(This is a fork of Michael's original gist with some editing of the unions + records sections.)
Each of these examples assume the usage of --strict
mode in Typescript
Can be implemented using “Custom Types”
(This is a fork of Michael's original gist with some editing of the unions + records sections.)
Each of these examples assume the usage of --strict
mode in Typescript
Can be implemented using “Custom Types”
I haven't found a way to set your main profile photo on meetup.com such that it overrides any old photos you have set in individual groups. This script will do just that — set your group specific profile photo to your main photo for every group you're in.
Here's what to do:
enter
:var memberId = 56746842; // <=== Edit this
import sys | |
from time import sleep | |
import random | |
import cursor | |
class Renderer: | |
def __init__(self, width, height): |
default_run_options[:pty] = true # Must be set for the password prompt from git to work | |
set :ssh_options, { :forward_agent => true } | |
set :user, "smash" | |
set :application, "SMASH! Join Us" | |
set :domain, "linode.smash.org.au" | |
set :deploy_to, "/var/www/smash.org.au/2014-staff-call" | |
set :shared_path, "#{deploy_to}/shared" | |
set :use_sudo, false | |
<?php | |
header("Content-Disposition: binary/data"); | |
preg_match('/([^\/]+)\/favicon.ico/', $_SERVER['REQUEST_URI'], $matches); | |
echo (file_exists(getenv('cachedir').'/'.$matches[1]) ? file_put_contents(getenv('cachedir').'/'.$matches[1], file_get_contents('http://'.$matches[1].'/favicon.ico')) : file_get_contents(getenv('cachedir').'/'.$matches[1])); | |
// see that. thats fucking magestic is what it is. |
This is the code that powers the parallax effect on codetunes.com.
I think it’s quite chaotic at the moment and waits for being released as open source when it’s cleaned up.
# Consider the following | |
class ApplicationController < ActionController::Base | |
helper_method :current_filter | |
private | |
def current_filter | |
ActiveSupport::StringInquirer.new(params[:filter] || '') | |
end | |
end |
#ruby | |
[1,2,3,4].select{ |x| x.even? } | |
#python | |
[x for x in [1,2,3,4] if not x%2] | |
#or, more norvingly | |
filter(lambda x: not x%2, [1,2,3,4]) | |
#clojure | |
(filter #(even? % ) [1 2 3 4]) |
# GitHub::SQL - a helping hand for SQL in a rails app. | |
# | |
# Built for MySQL, adaptations and updates welcome. | |
# | |
# Authors/maintainers: @jbarnette, @zerowidth, et. al. | |
# | |
# The MIT License (MIT) | |
# | |
# Copyright (c) 2014 GitHub, Inc. | |
# |
require 'rspec' | |
require 'rspec/autorun' | |
module Foo | |
end | |
RSpec.describe Foo do | |
it "tests" do | |
expect(subject.class).to eq(Foo) | |
end |