Skip to content

Instantly share code, notes, and snippets.

View mariogarcia-ar's full-sized avatar
🎯
Focusing

Mario Garcia mariogarcia-ar

🎯
Focusing
  • https://wizefin.tech/
  • Rosario, Santa Fe, Argentina
View GitHub Profile
@mblondel
mblondel / perceptron.py
Last active April 21, 2024 13:42
Kernel Perceptron
# Mathieu Blondel, October 2010
# License: BSD 3 clause
import numpy as np
from numpy import linalg
def linear_kernel(x1, x2):
return np.dot(x1, x2)
def polynomial_kernel(x, y, p=3):
@dkleehammer
dkleehammer / app.js
Created July 31, 2013 22:08
Backbone/Marionette JS session handling example
define([
'marionette',
'router',
'controller',
'modules/auth',
'modules/vent',
'views/_layout'
], function(Marionette, Router, Controller, Auth, Vent, Layout){
var App = new Marionette.Application();
@nkint
nkint / gist:8563954
Last active September 7, 2023 05:18
ffmpeg in the shell: extracting the first frame of video
i=1
for avi in *.mp4; do
name=`echo $avi | cut -f1 -d'.'`
jpg_ext='.jpg'
echo "$i": extracting the first frame of the video "$avi" into "$name$jpg_ext"
ffmpeg -loglevel panic -i $avi -vframes 1 -f image2 "$name$jpg_ext"
i=$((i+1))
done
@georgymh
georgymh / imageresizing.php
Last active December 6, 2024 18:39
PHP Image resizing and cropping methods.
<?php
/*
Creates a thumbnail keeping the aspect ratio of the source image, and
saves it to a destination $dest.
Credits: http://davidwalsh.name/create-image-thumbnail-php
*/
function make_thumb($src, $dest, $desired_width) {
$info = getimagesize($src);
@shaunhess
shaunhess / CentOS7_min_desktop_setup.txt
Created March 10, 2016 17:21
CentOS7 Minimal Desktop Installation
1. Install CentOS 7 - Minimal
2. yum groupinstall "X Window System"
3. yum install gnome-classic-session gnome-terminal nautilus-open-terminal control-center liberation-mono-fonts
4. unlink /etc/systemd/system/default.target
5. ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target
6. reboot
@oscarruesga
oscarruesga / unshare_drive.py
Created March 17, 2016 05:40
Python script to unshare drive files and folders recursively
"""Delete domain permission from your Google Drive files.
The reason why I created this script is so that I can use this script to
recursively remove the domain permission item from all files.
By default, Google Drive will share files to all users in the domain (this
setting is recognised as the domain permission type for the file in
Google Drive). I don't really want certain files to be shared this way, but
there is no easy way recursively fix this in Google Drive, so that is why
this script is created.
@santisbon
santisbon / Update-branch.md
Last active June 4, 2025 20:58
Deploying from #Git branches adds flexibility. Bring your feature branch up to date with master and deploy it to make sure everything works. If everything looks good the branch can be merged. Otherwise, you can deploy your master branch to return production to its stable state.

Updating a feature branch

First we'll update your local master branch. Go to your local project and check out the branch you want to merge into (your local master branch)

$ git checkout master

Fetch the remote, bringing the branches and their commits from the remote repository. You can use the -p, --prune option to delete any remote-tracking references that no longer exist in the remote. Commits to master will be stored in a local branch, remotes/origin/master.

@alexcasalboni
alexcasalboni / amazon-rekognition.md
Last active October 11, 2024 16:44
Amazon Rekognition - Python Code Samples

Amazon Rekognition - Python Code Samples

  1. Labels Detection
  2. Faces Detection
  3. Faces Comparison
  4. Faces Indexing
  5. Faces Search
for i in 1 2 3; do
docker-machine create -d virtualbox node-$i
done
eval $(docker-machine env node-1)
docker swarm init \
--advertise-addr $(docker-machine ip node-1)
docker swarm join-token -q manager
@dahlbyk
dahlbyk / github.md
Last active April 22, 2023 11:48
Mastering GitHub

Mastering GitHub

GitHub is often used as a basic Git host, but its platform has so much more to offer. From simple and powerful issues and pull requests, to advanced features for power users and integrators, it’s a tool worth knowing well in its own right. This session will review everything you need to know to master collaboration with GitHub, from best practices for GitHub Issues and how it represents basic Git concepts, to hidden features and the tools enabling its developer ecosystem.

  • Git Hosting