Skip to content

Instantly share code, notes, and snippets.

View redstar504's full-sized avatar
🇨🇦

Brayden redstar504

🇨🇦
View GitHub Profile
@redstar504
redstar504 / proxy-set.js
Last active September 15, 2020 23:21
Proxy matrix with setter
const [width, height] = [10,10] // 10x10 matrix
const element = (index) => index;
const array = Array.from({length: width * height}, (_,index) => index);
const handler = {
get: (array, rowIndex) => {
return new Proxy(array.slice(width * +rowIndex, width * (+rowIndex + 1)), Object.assign({array, rowIndex, width}, handler));
},
<!DOCTYPE html><html><head resURL="/static/cbf759d8"> <title>Jenkins [Jenkins]</title><link rel="stylesheet" type="text/css" href="/static/cbf759d8/css/style.css" /><link rel="stylesheet" type="text/css" href="/static/cbf759d8/css/color.css" /><link rel="stylesheet" type="text/css" href="/static/cbf759d8/css/responsive-grid.css" /><link rel="shortcut icon" type="image/vnd.microsoft.icon" href="/static/cbf759d8/favicon.ico" /><script>var isRunAsTest=false; var rootURL=""; var resURL="/static/cbf759d8";</script><script src="/static/cbf759d8/scripts/prototype.js" type="text/javascript"></script><script src="/static/cbf759d8/scripts/behavior.js" type="text/javascript"></script><script src='/adjuncts/cbf759d8/org/kohsuke/stapler/bind.js' type='text/javascript'></script><script src="/static/cbf759d8/scripts/yui/yahoo/yahoo-min.js"></script><script src="/static/cbf759d8/scripts/yui/dom/dom-min.js"></script><script src="/static/cbf759d8/scripts/yui/event/event-min.js"></script><script src="/stati
Traceback (most recent call last):
File "/home/doccafe/mailpiping/pipe.py", line 20, in ?
logging.basicConfig(filename='/var/log/mailpipe.log', level=logging.DEBUG, format='%(asctime)s %(message)s', datefmt='%Y-%m-%d %H:%M:%S')
File "/usr/lib64/python2.4/logging/__init__.py", line 1218, in basicConfig
hdlr = FileHandler(filename, mode)
File "/usr/lib64/python2.4/logging/__init__.py", line 757, in __init__
stream = open(filename, mode)
IOError: [Errno 13] Permission denied: '/var/log/mailpipe.log'
Traceback (most recent call last):
File "/home/doccafe/mailpiping/pipe.py", line 20, in ?
logging.basicConfig(filename='/var/log/mailpipe.log', level=logging.DEBUG, format='%(asctime)s %(message)s', datefmt='%Y-%m-%d %H:%M:%S')
File "/usr/lib64/python2.4/logging/__init__.py", line 1218, in basicConfig
hdlr = FileHandler(filename, mode)
File "/usr/lib64/python2.4/logging/__init__.py", line 757, in __init__
stream = open(filename, mode)
IOError: [Errno 13] Permission denied: '/var/log/mailpipe.log'
var markets = $.parseJSON([{"name":"Dallas","distance":1655},{"name":"Austin","distance":1761},{"name":"Houston","distance":1865},{"name":"Raleigh","distance":2248}]);
@redstar504
redstar504 / gist:6666644
Created September 23, 2013 05:10
vagrant ssh
INFO global: Vagrant version: 1.3.3
DEBUG global: Loading core plugin: C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.3.3/plugins/commands/box/plugin.rb
INFO manager: Registered plugin: box command
DEBUG global: Loading core plugin: C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.3.3/plugins/commands/destroy/plugin.rb
INFO manager: Registered plugin: destroy command
DEBUG global: Loading core plugin: C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.3.3/plugins/commands/halt/plugin.rb
INFO manager: Registered plugin: halt command
DEBUG global: Loading core plugin: C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.3.3/plugins/commands/help/plugin.rb
INFO manager: Registered plugin: help command
DEBUG global: Loading core plugin: C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.3.3/plugins/commands/init/plugin.rb
@redstar504
redstar504 / gist:6666563
Created September 23, 2013 04:54
Vagrant boot_timeout debug
INFO global: Vagrant version: 1.3.3
DEBUG global: Loading core plugin: C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.3.3/plugins/commands/box/plugin.rb
INFO manager: Registered plugin: box command
DEBUG global: Loading core plugin: C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.3.3/plugins/commands/destroy/plugin.rb
INFO manager: Registered plugin: destroy command
DEBUG global: Loading core plugin: C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.3.3/plugins/commands/halt/plugin.rb
INFO manager: Registered plugin: halt command
DEBUG global: Loading core plugin: C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.3.3/plugins/commands/help/plugin.rb
INFO manager: Registered plugin: help command
DEBUG global: Loading core plugin: C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.3.3/plugins/commands/init/plugin.rb
language: php
php:
- 5.4
before_script:
# Application specific config
- cp app/config/parameters.yml.dist app/config/parameters.yml
- cp behat.yml.dist behat.yml
- composer install --dev --prefer-dist
C:\Users\Brayden>vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
[default] Box 'precise32' was not found. Fetching box from specified URL for
the provider 'virtualbox'. Note that if the URL does not have
a box for this provider, you should interrupt Vagrant now and add
the box yourself. Otherwise Vagrant will attempt to download the
full box prior to discovering this error.
Downloading or copying the box...
←[0KExtracting box...ate: 1994k/s, Estimated time remaining: --:--:--)
Successfully added box 'precise32' with provider 'virtualbox'!
@redstar504
redstar504 / gist:5691676
Created June 1, 2013 20:44
CreditCardType
<?php
namespace Site\FrontendBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Site\FrontendBundle\Entity\CreditCard;
class CreditCardType extends AbstractType