Skip to content

Instantly share code, notes, and snippets.

View skynet's full-sized avatar

Ionel Roiban skynet

View GitHub Profile
const Twit = require('twit')
exports.main = (args) => {
let twitter_consumer_key = args.twitter_consumer_key
let twitter_consumer_secret = args.twitter_consumer_secret
let twitter_access_token = args.twitter_access_token
let twitter_access_token_secret = args.twitter_access_token_secret
// If the required tokens aren't received end all operations
if (!twitter_consumer_key || !twitter_consumer_secret ||
Verifying my Blockstack ID is secured with the address 1JQq8a9ijhMnxW7ViRFyxZMnuzZj8KA52i https://explorer.blockstack.org/address/1JQq8a9ijhMnxW7ViRFyxZMnuzZj8KA52i
@skynet
skynet / galleria-video-pause.js
Created August 25, 2017 23:08 — forked from tomjnsn/galleria-video-pause.js
Wire up Galleria to detect YouTube and Vimeo videos playing so it pauses the slideshow while videos are playing.
var autoplayLength = 8000;
var gallery = false;
var ytplayer = false;
$(function() {
if (window.addEventListener) {
window.addEventListener('message', messageReceived, false);
} else {
window.attachEvent('onmessage', messageReceived, false);
}
@skynet
skynet / galleria-video-pause.js
Created August 25, 2017 23:08 — forked from tomjnsn/galleria-video-pause.js
Wire up Galleria to detect YouTube and Vimeo videos playing so it pauses the slideshow while videos are playing.
var autoplayLength = 8000;
var gallery = false;
var ytplayer = false;
$(function() {
if (window.addEventListener) {
window.addEventListener('message', messageReceived, false);
} else {
window.attachEvent('onmessage', messageReceived, false);
}
@skynet
skynet / touch-icons.html
Created November 2, 2015 05:14 — forked from kevinSuttle/touch-icons.html
Touch icon link syntax
<!-- For non-Retina iPhone, iPod Touch, and Android 2.1+ devices: -->
<link rel="apple-touch-icon-precomposed" href="apple-touch-icon-precomposed.png">
<!-- For the iPad mini and the first- and second-generation iPad on iOS ≤ 6: -->
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="apple-touch-icon-72x72-precomposed.png">
<!-- For the iPad mini and the first- and second-generation iPad on iOS ≥ 7: -->
<link rel="apple-touch-icon-precomposed" sizes="76x76" href="apple-touch-icon-76x76-precomposed.png">
<!-- For iPhone with high-resolution Retina display running iOS ≤ 6: -->
@skynet
skynet / AWSLambdaSimpleSMS.js
Last active September 2, 2015 19:43 — forked from stevebowman/AWSLambdaSimpleSMS.js
AWS Lambda Function to send an SMS message via the Twilio API
console.log('Loading event');
// Twilio Credentials
var accountSid = '';
var authToken = '';
var fromNumber = '';
var https = require('https');
var queryString = require('querystring');
@skynet
skynet / gist:7e0830b0376af3a0c6e0
Created August 31, 2015 22:02
Convert Amazon AMI to VMware image
If you still have access to the instance, use "dd" to copy it off to a raw file (possibly just directly piping over SSH to the destination system like in ssh your.ec2-syst.em 'dd if=/dev/sdh bs=1M | gzip' | gunzip | dd of=/tmp/ec2-image.raw) and then using something like qemu-img to convert the raw image to a VMDK file.
Okay for centos 6.4 also
On apu.0xdata.loc, after this install was done
$ which python
/usr/local/bin/python
$ python -V
Python 2.7.3
$ ls -ltr /usr/local/bin/pyth*
@skynet
skynet / nginx.conf
Last active August 29, 2015 05:35 — forked from meineerde/nginx.conf
Check the Accept-Language Header to emulate part of Apache's content negotiation features. This is based on http://stackoverflow.com/questions/3657614/how-to-rewrite-location-in-nginx-depending-on-the-client-browsers-language
map $http_accept_language $lang {
default en;
~de de;
~en en;
}
location /foo/bar/baz/lang.js {
try_files $uri.$lang $uri;
}
@skynet
skynet / configure_proxy_protocol.md
Last active August 29, 2015 14:27 — forked from pablitoc/configure_proxy_protocol.md
Configuring Proxy Protocol

##Install AWS CLI Tools##

  1. Install AWS CLI Tools. You can also use the EC2 API Tool if you are more comfortable with them. But this write-up uses the EC2 CLI.
  2. Create a user via Amazon IAM or download the security accessID and securitykey you will need it to query Amazon CLI.
  3. using Terminal cd into .aws directory cd ~/.aws edit or create new file named config paste the following contents inside.
    `[default]`
    `aws_access_key_id = ACCESS_ID`
    `aws_secret_access_key = SECRET_ID`
    `output = json OR bson OR text`
    `region = PREFERRED_AWS_REGION`

Save the file as "config"