Skip to content

Instantly share code, notes, and snippets.

View talcual's full-sized avatar
💭
Magic Code

Luis Toscano talcual

💭
Magic Code
View GitHub Profile
@robertov8
robertov8 / hotspot.md
Last active August 30, 2023 13:12
Install Hotspot + Mysql + Portal Captive + WifiDog + Authpuppy

Hotspot + Portal Captive

Dependencias

  • Header Kernel - GCC

sudo apt-get install linux-headers

  • Pacotes essenciais
@tvdsluijs
tvdsluijs / gist:fc0bb40ee0fe0805df8d
Created January 9, 2015 19:01
Mongodb php aggregation $match $or usage
$m = new MongoClient(); // connect to local mongodb
$db = $m->products; //select 'mongo database' named products
$clothing_col = $db->clothing; //create a collection from the 'table' clothing
//create the aggregation
//create the Match on clothing-category = shoes or brand = nike
$ops = array(
array(
'$match' =>
array('$or' =>
@javoperez
javoperez / sensores.py
Created April 4, 2014 18:45
Lectura de sensores Infrarrojos en Raspberry Pi y python
print "Hola"
estado= None
y= None
while 1:
A= input ("Dame el valor de A")
B= input ("Dame el valor de B")
if A==1:
@olasd
olasd / stream_to_youtube.sh
Created March 28, 2014 19:58
Stream video to youtube via ffmpeg
#! /bin/bash
#
# Diffusion youtube avec ffmpeg
# Configurer youtube avec une résolution 720p. La vidéo n'est pas scalée.
VBR="2500k" # Bitrate de la vidéo en sortie
FPS="30" # FPS de la vidéo en sortie
QUAL="medium" # Preset de qualité FFMPEG
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" # URL de base RTMP youtube
@julionc
julionc / 00.howto_install_phantomjs.md
Last active April 26, 2024 09:13
How to install PhantomJS on Debian/Ubuntu

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
@victorb
victorb / app.js
Created September 24, 2013 16:37
Easy AngularJS Directive for Google Places Autocomplete
var myApp = angular.module('myApp', []);
myApp.directive('googleplace', function() {
return {
require: 'ngModel',
link: function(scope, element, attrs, model) {
var options = {
types: [],
componentRestrictions: {}
};
@tedmiston
tedmiston / nodejs-tcp-example.js
Last active February 19, 2024 21:55
Node.js TCP client and server example
/*
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp
server, but for some reason omit a client connecting to it. I added an
example at the bottom.
Save the following server in example.js:
*/
var net = require('net');
@codler
codler / gist:5383971
Created April 14, 2013 19:56
IRC bot, Node.js v0.6, 2011-12-15 Read and write to both irc and file. Two-way communication.
var util = require('util'),
net = require('net');
fs = require('fs');
vm = require('vm');
repl = require('repl');
var socket = new net.Socket();
socket.setNoDelay(true);
socket.setEncoding('ascii');
@vodolaz095
vodolaz095 / print.js
Last active August 30, 2023 20:47
Print for NodeJS using CUPS backend
var ipp = require('ipp'); //get it from there - https://npmjs.org/package/ipp - $npm install ipp
var request = require('request'); //get it from there - https://npmjs.org/package/request - $npm install request
var fs = require('fs');
function getPrinterUrls(callback) {
var CUPSurl = 'http://localhost:631/printers';//todo - change of you have CUPS running on other host
request(CUPSurl, function (error, response, body) {
if (!error && response.statusCode == 200) {
var printersMatches = body.match(/<TR><TD><A HREF="\/printers\/([a-zA-Z0-9-^"]+)">/gm);//i know, this is terrible, sorry(
var printersUrls = [];
@ghalimi
ghalimi / PV.js
Created January 25, 2013 23:27
PV Function
// Copyright (c) 2012 Sutoiku, Inc. (MIT License)
function PV(rate, periods, payment, future, type) {
// Initialize type
var type = (typeof type === 'undefined') ? 0 : type;
// Evaluate rate and periods (TODO: replace with secure expression evaluator)
rate = eval(rate);
periods = eval(periods);