Skip to content

Instantly share code, notes, and snippets.

@suhailvs
suhailvs / Openshift27.md
Last active August 29, 2015 13:56
Openshift python -2.7, django-1.6 example

Steps to create in OPENSHIFT

  1. Create a Python27 app in Openshift

create a python2.7 application in openshift

if you still don't uploaded the ssh publickey to openshift, then doit:

@0xdevalias
0xdevalias / HackMeSomeUnicoins.md
Last active August 29, 2015 13:57
A quick little hack to automagically mine unicoins (stackoverflow.com April Fools 2014) <3 /dev/alias (www.devalias.net)

First, go to stackoverflow.com then define this in your Javascript console:

var hackMeSomeUnicoins = function(myFkey) {
  console.log("Ok, let's hack you some shiny unicoins! <3 /dev/alias (www.devalias.net)")
  console.log("The powers that be say you can only mine a rock every 10sec, so we do it every 11sec to be sure.")
  window.setInterval(function(){
    $.get( "http://stackoverflow.com/unicoin/rock", function( data ) {
      var rockId = data.rock;
      $.post( "http://stackoverflow.com/unicoin/mine?rock=" + rockId, { fkey: myFkey })
 .done(function( data ) {

Much nicer solution can be used for any stackexchange sites::: First, go to stackoverflow.com(or any other stackexchange sites) then define this in your Javascript console(Press F12):

function minec(){ 
  $.getJSON('/unicoin/rock',function(data) {
    setTimeout(function(){
      $.post('/unicoin/mine?rock='+data.rock,{fkey:StackExchange.options.user.fkey})
      .done(function( data ) {
        console.log(data);

});

@nrabinowitz
nrabinowitz / progsvc.php
Created August 6, 2011 04:19
Mock PHP service for timemap.js progressive loading
<?
// get timestamps
$start = strtotime($_GET['start']);
$end = strtotime($_GET['end']);
$cb = $_GET['callback'];
// start data
echo "$cb([";
@bkono
bkono / spin-js-example.html
Created August 21, 2011 19:27
spin.js example
<!doctype html>
<head>
<title>Hi</title>
<style>
#spin {
background: #333;
color: white;
float: left;
width: 200px;
height: 200px;
from django.http import HttpResponseRedirect
from django.conf import settings
from re import compile
EXEMPT_URLS = [compile(settings.LOGIN_URL.lstrip('/'))]
if hasattr(settings, 'LOGIN_EXEMPT_URLS'):
EXEMPT_URLS += [compile(expr) for expr in settings.LOGIN_EXEMPT_URLS]
class LoginRequiredMiddleware:
"""
@suhailvs
suhailvs / IndexedDB101.html
Last active April 16, 2020 22:24 — forked from JamesMessinger/IndexedDB101.js
Very Simple IndexedDB Example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>IndexedDB</title>
</head>
<body>
<!-- https://www.codeproject.com/Articles/325135/Getting-Started-with-IndexedDB -->
<output id="printOutput"></output>
@Toilal
Toilal / api.module.ts
Last active February 21, 2023 10:30
@auth0/angular2-jwt Authorization Service and HttpInterceptor supporting JWT Refresh Token (Angular 4.3+ & 5+)
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { JWT_OPTIONS, JwtInterceptor, JwtModule } from '@auth0/angular-jwt';
import { AuthorizationService } from './authorization.service';
import { environment } from '../../environments/environment';
import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
import { RefreshTokenInterceptor } from './refresh-token-interceptor';
function jwtOptionsFactory (authorizationService: AuthorizationService) {
return {
@faelp22
faelp22 / server.py
Last active March 22, 2023 13:55
Python3 SimpleHTTPServer for Static Serving (VueJS/ React / Angular / Ember) in HTML5 mode (a la mod_rewrite)
#!/usr/bin/env python
'''
Based on https://gist.github.com/chrisbolin/2e90bc492270802d00a6
'''
import os
from http.server import HTTPServer, SimpleHTTPRequestHandler
from urllib.parse import urlparse
@johncantrell97
johncantrell97 / satoshistreasure.md
Last active April 15, 2023 15:09
How I Obtained Satoshi's Treasure Keys 1, 2, and 3 in Minutes

Today (April 16th 2019 at noon) the first major clues to discover key #1 was set to be released in a few cities. A QR code with the words 'orbital' were found at these locations and looked like this: (https://imgur.com/a/6rNmz7T). If you read the QR code with your phone you will be directed to this url: https://satoshistreasure.xyz/k1

At this URL you are prompted to input a passphrase to decrypt the first shard. An obvious first guess was to try the word 'orbital' from the QR code. Not suprisingly this worked! This reveals a congratulations page and presents the first key shard:

ST-0001-a36e904f9431ff6b18079881a20af2b3403b86b4a6bace5f3a6a47e945b95cce937c415bedaad6c86bb86b59f0b1d137442537a8.

Now, we were supposed to wait until April 17th to get clues from the other cities for keys #2 and #3 but that wouldn't stop me from digging around with all the new information we had. All that time "playing" notpron (http://notpron.org/notpron/) years ago was going to help me here.

The first thing I noticed was