Skip to content

Instantly share code, notes, and snippets.

Avatar

Julian Lamprea jalamprea

View GitHub Profile
View gulpfile for dev and prod
'use strict';
const { src, dest, watch, series } = require('gulp');
const browserSync = require('browser-sync').create();
const del = require('del');
const sass = require('gulp-sass');
const newer = require('gulp-newer');
const cssmin = require('gulp-cssmin');
const jshint = require('gulp-jshint');
const concat = require('gulp-concat');
const rename = require('gulp-rename');
@jalamprea
jalamprea / git-config-golang-private-github.md
Last active Mar 18, 2020 — forked from dmitshur/gist:6927554
How to `go get` private repos using SSH key auth instead of password auth.
View git-config-golang-private-github.md
$ git config --global url."git@github.com:".insteadOf "https://github.com/"
$ cat ~/.gitconfig
[url "git@github.com:"]
	insteadOf = https://github.com/
$ go get github.com/private/repo && echo Success!
Success!

Sources:

View kubectl backup script
for n in $(kubectl get -o=name pvc,configmap,serviceaccount,secret,ingress,service,deployment,statefulset,hpa,job,cronjob)
do
mkdir -p $(dirname $n)
kubectl get -o=yaml --export $n > $n.yaml
done
@jalamprea
jalamprea / http-request.php
Last active Jan 19, 2020
A native way to do HTTP Request using CURL, without external dependencies.
View http-request.php
// Send data to another endpoint using CURL
function callAPI($url=false, $params=array(), $method='GET', $isJson=false) {
if ($url) {
//open connection
$ch = curl_init();
// $ip = $_SERVER['REMOTE_ADDR'];
if($method==='GET' && !empty($params)) {
$query_params = http_build_query($params);
@jalamprea
jalamprea / YoutubeSearcher.js
Created Aug 6, 2019
Implementation of Youtube Search API with Pure Javascript
View YoutubeSearcher.js
var YoutubeSearcher = (function() {
function YoutubeSearcher() {
this.configuration = {};
this.dependencies = {};
}
YoutubeSearcher.prototype.searchSongs = function(query) {
var dependencies = this.dependencies;