Skip to content

Instantly share code, notes, and snippets.

View carpincho's full-sized avatar

Joaquín T carpincho

View GitHub Profile
@carpincho
carpincho / Wistia-download-videos.md
Created January 11, 2024 04:53 — forked from szepeviktor/Wistia-download-videos.md
Download Wistia videos - Please do not misuse it!

Download Wistia videos

  1. right-click on the playing video, select Copy link
  2. find Wistia video ID in the copied link e.g. wvideo=tra6gsm6rl
    • alternative: look for e.g. hashedId=tra6gsm6rl in the page source
  3. load http://fast.wistia.net/embed/iframe/ + video ID in your browser
  4. look for "type":"original" in the page source and copy the URL from the next line e.g. "url":"http://embed.wistia.com/deliveries/129720d1762175bcd8e06dcab926ec76ad38ff00.bin"
  • alternative: look for "type":"hd_mp4_video"
<div class="font-bold bg-blue-200 text-red-400 m-10">
<div class="block sm:hidden">xs</div>
<div class="hidden sm:block md:hidden">sm</div>
<div class="hidden md:block lg:hidden">md</div>
<div class="hidden lg:block xl:hidden">lg</div>
<div class="hidden xl:block">xl</div>
</div>
@carpincho
carpincho / demo.html
Created December 11, 2020 13:59 — forked from JeffreyWay/demo.html
Alpine.js Transition demo
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Alpine Examples</title>
<script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.x.x/dist/alpine.min.js"
defer
></script>
@carpincho
carpincho / script.sh
Created September 24, 2019 16:39 — forked from vielhuber/script.sh
PostgreSQL: Backup and restore pg_dump with password on command line #sql
# best practice: linux
nano ~/.pgpass
*:5432:*:username:password
chmod 0600 ~/.pgpass
# best practice: windows
edit %APPDATA%\postgresql\pgpass.conf
*:5432:*:username:password
# linux
@carpincho
carpincho / happy_git_on_osx.md
Created February 11, 2019 23:16 — forked from trey/happy_git_on_osx.md
Creating a Happy Git Environment on OS X

Creating a Happy Git Environment on OS X

Step 1: Install Git

brew install git bash-completion

Configure things:

git config --global user.name "Your Name"

git config --global user.email "you@example.com"

@carpincho
carpincho / latency.txt
Created June 21, 2018 01:56 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@carpincho
carpincho / nginx.conf
Created July 27, 2016 13:52 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@carpincho
carpincho / models.py
Last active August 29, 2015 14:15 — forked from qingfeng/models.py
from django.db import models
class M1(models.Model):
title = models.CharField(max_length=100)
img1 = models.ImageField(upload_to="static/")
def __unicode__(self):
return self.title
// This function gets cookie with a given name
function getCookie(name) {
var cookieValue = null;
if (document.cookie && document.cookie != '') {
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
var cookie = jQuery.trim(cookies[i]);
// Does this cookie string begin with the name we want?
if (cookie.substring(0, name.length + 1) == (name + '=')) {
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"