Skip to content

Instantly share code, notes, and snippets.

View leftdevel's full-sized avatar
🏠
Working from home

Oscar Balladares M. leftdevel

🏠
Working from home
View GitHub Profile
@leftdevel
leftdevel / delete-branches-on-screen.js
Last active February 10, 2020 15:06
delete github branches on screen
// Using this for branches displayed on the "stale branches" page, under https://github.com/yourOrg/yourProject/branches/stale
// Meant to be copy & paste into the browser console.
var i = 0;
function deleteOne() {
// Idempotent selector, should select only Delete buttons that are not already clicked. When clicked, the UI
// updates and replaces Details class with Details--on.
var deleteButton = document.querySelectorAll('li.Details form button.text-red.js-branch-delete-target')[i];
@leftdevel
leftdevel / Rakefile.rb
Created October 30, 2018 02:10
Rake task for publishing/promoting a Jekyll draft to a post.
require 'fileutils'
task :publish do
# Read files in the _drafts/ directory (skips hidden files and sub directories)
drafts = Dir["./_drafts/*"].select {|f| !File.directory? f}
# Show a numbered list of the name of the files.
drafts.each_with_index do |file_name, index|
puts "#{index + 1}) " + File.basename(file_name)
end
@leftdevel
leftdevel / Dockerfile
Last active September 19, 2016 16:57
Docker JQJobs db.
# Warning. This is just a test DB. Use this when testing the webapp, autoscaler or notifications services.
# Connecting to the prod DB is done on convox dashboard by setting the connection parameters as ENV variables.
FROM ubuntu:16.04
# Add the PostgreSQL PGP key to verify their Debian packages.
# It should be the same key as https://www.postgresql.org/media/keys/ACCC4CF8.asc
RUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8
# Add PostgreSQL's repository. It contains the most recent stable release of PostgreSQL, ``9.3``.
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" > /etc/apt/sources.list.d/pgdg.list
<?php
namespace LeftDevel\Form\Transformer;
use Symfony\Component\Form\DataTransformerInterface;
use Symfony\Component\Form\Exception\TransformationFailedException;
class MultiOrderTransformer implements DataTransformerInterface
{
public function transform($length)
@leftdevel
leftdevel / react-sortable
Created April 9, 2015 05:40
React with jQuery Sortable example.
// Quick and dirty example.
// For a more robust solution check https://gist.github.com/petehunt/7882164
var Sortable = React.createClass({
getInitialState: function() {
return {
items: [
'Item1',
'Item2',
'Item3',
<?php
namespace NicaStaff\IQAHBundle\Form\EventListener;
use Symfony\Component\Form\Event\DataEvent;
use Symfony\Component\Form\FormFactoryInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Form\FormEvents;
use NicaStaff\IQCoreBundle\Entity;
class AddPositionLabelSubscriber implements EventSubscriberInterface
<?php
/**
* Este es el action donde se envió el formulario.
*/
public function paso2Action()
{
$object = new Object();
$request = $this->getRequest();
$form = $this->createForm(new ObjectType(), $object);
@leftdevel
leftdevel / execute_report.php
Created November 24, 2011 22:31
execute_report
<?php
//linea 321
$links = '';
//NicaStaff was here. Some code added from here to line 337
$allInOneParams='';
foreach($recordings as $position => $recording)
{