Skip to content

Instantly share code, notes, and snippets.

View andrelince's full-sized avatar
🤙
Coding

André Faria andrelince

🤙
Coding
  • Portugal
View GitHub Profile
@inorganik
inorganik / email-subscribe-form.component.ts
Last active July 4, 2025 08:33
MailChimp subscribe form with Angular 5 using jsonp
import { Component } from '@angular/core';
import { FormControl, Validators } from '@angular/forms';
import { HttpClient, HttpParams } from '@angular/common/http';
interface MailChimpResponse {
result: string;
msg: string;
}
@Component({
@hemant-tivlabs
hemant-tivlabs / WP3.5 Media Uploader
Last active June 20, 2019 12:53 — forked from mauryaratan/WP3.5 Media Uploader
WordPress 3.5 media uploader in easier steps. If using other than edit post screen, don't forget to use wp_enqueue_media(); in your functions.php
jQuery(document).ready(function($){
var _custom_media = true,
_orig_send_attachment = wp.media.editor.send.attachment;
$('.stag-metabox-table .button').click(function(e) {
var send_attachment_bkp = wp.media.editor.send.attachment;
var button = $(this);
var id = button.attr('id').replace('_button', '');
_custom_media = true;
wp.media.editor.send.attachment = function(props, attachment){
if ( _custom_media ) {
@fishi0x01
fishi0x01 / baseURL.groovy
Last active February 3, 2025 16:37
This is a collection of groovy scripts I gathered and use for bootstrapping Jenkins. Most of this can also be achieved with the CasC Plugin https://github.com/jenkinsci/configuration-as-code-plugin
#!groovy
/*
* This script configures the Jenkins base URL.
*/
import jenkins.model.JenkinsLocationConfiguration
JenkinsLocationConfiguration location = Jenkins.instance.getExtensionList('jenkins.model.JenkinsLocationConfiguration')[0]
location.url = 'https://jenkins-as-code-poc.devtail.io/'
@EvgenyOrekhov
EvgenyOrekhov / A simple Docker and Docker Compose install script for Ubuntu.md
Last active April 28, 2026 01:03
A simple Docker and Docker Compose install script for Ubuntu

A simple Docker and Docker Compose install script for Ubuntu

Usage

  1. sh install-docker.sh
  2. log out
  3. log back in

Links

@DavideMontersino
DavideMontersino / private-fork.md
Last active September 27, 2025 23:26
How to fork to a private gitlab instance

Theory:

your git repository can have more than one remote server; In this case we want to have two:

  1. one for our private repository on gitlab (will be the default one, called origin)
  2. one to be connected to the source repo on github, to be able to pull new changes (will be called upstream)

How to make a private fork from github to gitlab

@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@msimonin
msimonin / commands
Last active December 29, 2023 07:09
install ubuntu on a virtual machine (libvirt / kvm)
# get the iso
wget http://releases.ubuntu.com/14.04.3/ubuntu-14.04.3-server-amd64.iso
# create the image disk
qemu-img create -f qcow2 disk.qcow2 10G
# launch the creation
virsh create ubuntu.xml
# you can connect to using vnc.
// MIT license (c) andelf 2013
import (
"net/smtp"
"errors"
)
type loginAuth struct {
username, password string
@LeoHuckvale
LeoHuckvale / gist:89683dc242f871c8e69b
Created February 2, 2015 16:53
matplotlib - Add subplots dynamically
@mxriverlynn
mxriverlynn / webcam.css
Last active March 30, 2020 12:05
webrtc webcam in 20 lines
body {
margin: 0px;
padding: 0px;
}
#player {
width: 100%;
height: 100%;
}