Skip to content

Instantly share code, notes, and snippets.

View S0c5's full-sized avatar
⛓️
joinbloque

David barinas S0c5

⛓️
joinbloque
View GitHub Profile
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDXjHPzNKz2S0hga54k1uSTmjmT0OJ4s6j53yWFJrcOIillCgGc9PTa625czh+TZLh2bjgmowTtVj4fNIVkzCdjEv145CJcYpTNvwjQ76l+9g4Pb6BCAAp0T4Q4C3Ku0V9C4G0AYL+Bn2d7FKoonLcZuk1A7HRAtETSI0isWr93fQ== [email protected]
// NO :)
System.out.println("los estudiantes que aprobaron fueron: " + pasaron + " y los que reprobaron fueron: " + reprobaron);
// yes
System.out.printf("los estudiantes que aprobaron fueron: %d y los que reprobaron fueron %d \n", pasaron, reprobaron);
function convert(from, to){
return fetch('https://www.google.com/finance/converter?a=1&from='+from+'&to='+to+'&meta=ei%3D0EUBWPCoAsermAG0oaiAAQ').then(res => res.text()).then(value => {
var doc = (new DOMParser()).parseFromString(value, "text/html");;
return +doc.querySelector('.bld').innerHTML.split(' ')[0]
});
}
/**
usage :
@S0c5
S0c5 / post.js
Created April 29, 2016 19:16
example default date with custom value
// before install : npm install moment --save
var mongoose = require('mongoose'),
moment = require('moment')
postSchema = new mongoose.Schema({
createdAt: {
type: Date,
default: Date.now
},
[ { "_id": "561d06b10afff657bca65e13", "index": 0, "guid": "49d3e981­71a4­44c4­be61­8f83413a991d", "isActive": false, "balance": "$1,636.66", "picture": "http://placehold.it/32x32", "age": 27, "eyeColor": "blue", "name": "Tisha Preston", "gender": "female", "company": "KROG", "email": "[email protected]", "phone": "+1 (919) 418­3974", "address": "549 Montague Street, Leola, Mississippi, 7715", "about": "Aute dolor velit nisi labore eiusmod Lorem duis ut laboris. Elit consectetur non ullamco excepteur eu. Ut ut aliquip enim commodo. Irure excepteur eiusmod in esse nostrud. Reprehenderit excepteur est fugiat duis anim in ut id exercitation id reprehenderit eu. Veniam consequat fugiat eiusmod occaecat. Anim laboris adipisicing ut in et pariatur consectetur aute proident consectetur aliqua.\r\n", "registered": "2015­03­23T03:36:19 +05:00", "latitude": "­12.571695", "longitude": 74.896764, "tags": [ "aliquip", "ea", "dolore", "mollit", "veniam", "minim", "sunt" ], "friends": [ { "id": 0, "name": "Charles Greer
someAsyncFunction(arg1, arg2, function(err, info){
if(err) return done(err);
.... // some logic
})
@S0c5
S0c5 / gist:10330613
Created April 9, 2014 23:42
git-update-receive
#!/bin/bash -l
APP_PATH=/home/ubuntu/www
GIT_WORK_TREE=$APP_PATH
export GIT_WORK_TREE
export PADRINO_ENV="production"
export RACK_ENV="production"
exit_with_error(){
echo "[DEPLOY] !!!!!!!!!!!!!!!!!!!! Un error ah ocurrido !!!!!!!!!!!!!!!!!!!!!!!"
exit 1
@S0c5
S0c5 / asdasd
Created March 29, 2014 21:33
adasdasdasdasdasd
<html>
<head><title>Hello</title></head>
<body>
<script src="bower_components/socket.io-client/dist/socket.io.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script>
var User={
times: 0,
state: "out"