This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var GCM = require('./gcm'); | |
var gcm = new GCM(<YOUR GOOGLE API KEY>); // https://code.google.com/apis/console | |
// create the message | |
var msg = { | |
registration_ids: [token], // this is the device token (phone) | |
collapse_key: "your_collapse_key", // http://developer.android.com/guide/google/gcm/gcm.html#send-msg | |
time_to_live: 180, // just 30 minutes | |
data: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import struct | |
import SocketServer | |
from base64 import b64encode | |
from hashlib import sha1 | |
from mimetools import Message | |
from StringIO import StringIO | |
# import threading | |
class WebSocketsHandler(SocketServer.StreamRequestHandler): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import struct | |
import SocketServer | |
from base64 import b64encode | |
from hashlib import sha1 | |
from mimetools import Message | |
from StringIO import StringIO | |
class WebSocketsHandler(SocketServer.StreamRequestHandler): | |
magic = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
image/webp webp; | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<section class="comments"> | |
<div class="g-comments" data-href="{{@blog.url}}{{url}}" data-first_party_property="BLOGGER" data-view_type="FILTERED_POSTMOD">Loading Google+ Comments ...</div> | |
<script async type="text/javascript" src="//apis.google.com/js/plusone.js?callback=gpcb"></script> | |
<noscript>Please enable JavaScript to view the <a href="https://plus.google.com/">comments powered by Google+.</a></noscript> | |
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma config(Motor, port3, leftMotor, tmotorVex393_MC29, openLoop) | |
#pragma config(Motor, port4, rightMotor, tmotorVex393_MC29, openLoop, reversed) | |
#pragma config(Motor, port5, handServo, tmotorServoStandard, openLoop) | |
#pragma config(Motor, port8, handServo2, tmotorServoStandard, openLoop) | |
#pragma config(Motor, port9, armMotor, tmotorVex269_MC29, openLoop) | |
task main () | |
{ | |
int handState1 = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -e | |
if [ -z "$SNAPCRAFT_SECRET" ]; then | |
exit 0 | |
fi | |
mkdir -p ".encrypted" | |
if [ ! -e ".encrypted/snapcraft.cfg.enc" ]; then | |
echo "Seeding a new macaroon." | |
echo "$SNAPCRAFT_CONFIG" > ".encrypted/snapcraft.cfg.enc" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Terminal 1 | |
docker exec -it CONTAINER_ID /bin/bash | |
npm install node-inspector | |
curl -O https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.tar.gz && tar -xvzf ngrok-stable-linux-amd64.tar.gz | |
kill -s USR1 $(pidof node) | |
node_modules/node-inspector/bin/inspector.js --web-port=9000 | |
# Press ctrl+z | |
bg | |
./ngrok http 9000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# (C) 2016, Deepak Kothandan | |
# This file is part of Ansible | |
# | |
# Ansible is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# Ansible is distributed in the hope that it will be useful, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const { exec } = require('child_process'); | |
const file = fs.readFileSync('replicasets4.txt').toString(); | |
// const file = fs.readFileSync('pods.txt').toString(); | |
(async () => { | |
const lines = file.split('\n'); | |
const total = lines.length; |
OlderNewer