Skip to content

Instantly share code, notes, and snippets.

View juananpe's full-sized avatar
🎯
Focusing

Juanan Pereira juananpe

🎯
Focusing
View GitHub Profile
@martinsik
martinsik / chat-frontend.js
Last active December 19, 2023 10:23
Node.js chat frontend and server
$(function () {
"use strict";
// for better performance - to avoid searching in DOM
var content = $('#content');
var input = $('#input');
var status = $('#status');
// my color assigned by the server
var myColor = false;
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active May 2, 2024 05:55
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@roxlu
roxlu / install_cygwin_sshd.txt
Last active November 27, 2023 22:20
Installing CYGWIN + SSHD for remote access through SSH on windows
Installing CYGWIN with SSH
1) Download cygwin setup.exe from http://www.cygwin.com
- Execute setup.exe
- Install from internet
- Root directory: `c:\cygwin` + all users
- Local package directory: use default value
- Select a mirror to download files from
- Select these packages:
- editors > xemacs 21.4.22-1
- net > openssh 6.1-p
@philfreo
philfreo / makepdf.js
Created June 24, 2013 23:21
PhantomJS: generate PDF to stdout from HTML in stdin. Example: echo "<b>test</b>" | phantomjs makepdf.js > test.pdf && open test.pdf
var page = require('webpage').create(),
fs = require('fs');
page.viewportSize = { width: 600, height: 600 };
page.paperSize = { format: 'Letter', orientation: 'portrait', margin: '1cm' };
page.content = fs.read('/dev/stdin');
window.setTimeout(function() {
page.render('/dev/stdout', { format: 'pdf' });
@owainlewis
owainlewis / java7.yml
Created July 24, 2013 10:45
Install Java 7 with Ansible on Ubuntu Linux
---
- name: ensure required packages are installed for Java 7
apt: name=$item state=latest update_cache=yes
with_items:
- python-software-properties
- name: Add Java repository to sources
action: apt_repository repo='ppa:webupd8team/java'
@bgun
bgun / gist:c7447ab0906517221b6b
Last active August 25, 2022 16:13
Practicing with IntelliJ and Git

Practicing with IntelliJ and Git

For the things we have to learn before we can do them,
we learn by doing them. ― Aristotle

This exercise is a straightforward recipe for starting a new IntelliJ project, adding a code file, and marrying a local Git repository to a remote GitHub repository. Even if you are comfortable with your Git workflow, you should go through this and understand what is happening - and more specifically, where on your computer's hard drive and on GitHub it is happening.

Repeat this exercise a few times, until you're comfortable. You don't have to memorize each command - that's what cheat sheets are for! - but rather, focus on understanding their relationships to the files on your computer, your development environment (IntelliJ), and GitHub.

Create a new IntelliJ project.

@tunelko
tunelko / weird_encodings.py
Last active January 10, 2020 21:35
weird_encodings
import base64
import sys
pt = sys.argv[1]
type_encoding = sys.argv[2]
atom128 = "/128GhIoPQROSTeUbADfgHijKLM+n0pFWXY456xyzB7=39VaqrstJklmNuZvwcdEC"
megan35 = "3GHIJKLMNOPQRSTUb=cdefghijklmnopWXYZ/12+406789VaqrstuvwxyzABCDEF5"
zong22 = "ZKj9n+yf0wDVX1s/5YbdxSo=ILaUpPBCHg8uvNO4klm6iJGhQ7eFrWczAMEq3RTt2"
hazz15 = "HNO4klm6ij9n+J2hyf0gzA8uvwDEq3X1Q7ZKeFrWcVTts/MRGYbdxSo=ILaUpPBC5"
@olih
olih / jq-cheetsheet.md
Last active May 3, 2024 17:42
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@primaryobjects
primaryobjects / linear-regression.Rmd
Last active November 13, 2018 02:51
Single variable linear regression, calculating baseline prediction, SSE, SST, R^2 of the model.
---
title: "Single Variable Linear Regression R^2"
output: html_document
---
The following figure shows three data points and the best fit line:
y = 3x + 2.
The x-coordinate, or "x", is our independent variable and the y-coordinate, or "y", is our dependent variable.
@cure53
cure53 / wordpress.md
Last active February 1, 2023 22:47
WordPress Flash XSS in flashmediaelement.swf