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 hashlib | |
hashlib.sha256("https://www.flipkart.com/".encode("utf-8")).hexdigest() |
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 joystickElem = document.getElementById('joystick'); | |
var joystick = new VirtualJoystick({ | |
container: joystickElem, | |
limitStickTravel: true, | |
stickRadius: 60, | |
mouseSupport: false | |
}); | |
var bsp = new BleSerialPort({address: 'd0:6a:cf:58:ee:bd'}); |
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 Bluetooth = require('./lib/blue_yeast').Bluetooth; | |
var device = Bluetooth.connect('BleFirmata', 'd0:6a:cf:58:ee:bd'); | |
device.on('connect', function() { | |
console.log('connect'); | |
try { | |
this.startNotifications(); | |
device.send(new Uint8Array([0xF0, 0x79, 0xF7])); | |
} catch(e) { | |
console.error(e); |
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
$.fn.countInt = function(duration, from) { | |
from = typeof from !== 'undefined' ? from : 0; | |
duration = typeof duration !== 'undefined' ? duration : 1000; | |
var $this = $(this); | |
var to = $this.text(); | |
$this.text(from); | |
$this.start = function() { | |
var stime = new Date().getTime(); | |
function step() { | |
var now = new Date().getTime(); |
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 os | |
import re | |
CSS_DIR = 'media/css/' | |
# CSS_PATTERN = re.compile('.+.less$') | |
# CSS_PATTERN = re.compile('.+.css$') | |
CSS_PATTERN = re.compile('.+.-all.css$') | |
total_files = 0 | |
total_loc = 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
/** | |
* Scratch-off canvas | |
* | |
* NOTE: this code monkeypatches Function.prototype.bind() if it doesn't | |
* already exist. | |
* | |
* NOTE: This is demo code that has been converted to be less demo-y. | |
* But it is still demo-y. | |
* | |
* To make (more) correct: |
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 urllib2 | |
from BeautifulSoup import BeautifulSoup | |
from django.shortcuts import render | |
def google_form(request, template='reg/gform.html', formkey=None): | |
gform = '' | |
if formkey: | |
soup = BeautifulSoup(urllib2.urlopen('https://docs.google.com/spreadsheet/viewform?formkey=%s' % formkey).read()) | |
formResult = soup('div', {'class': 'ss-form-container'}) |