book : The Elements of Computing Systems
This file contains hidden or 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
// ==UserScript== | |
// @name so | |
// @namespace ALL | |
// @version 1 | |
// @grant none | |
// @include http://sanchaya.lsgkerala.gov.in/assessment/* | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js | |
// @require https://greasyfork.org/scripts/1003-wait-for-key-elements/code/Wait%20for%20key%20elements.js?version=49342 | |
// ==/UserScript== | |
// ==UserScript== |
This file contains hidden or 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
<?php | |
if (isset($_POST['name'])) { | |
header('Content-type: application/json'); | |
if ($_POST['name'] != 'hi') { | |
$array = ['result' => 'fail', 'data' => '100']; | |
} else { | |
$array = ['result' => 'success', 'data' => '100']; | |
} | |
die(json_encode($array)); |
This file contains hidden or 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
#!/usr/bin/env ruby | |
require "fileutils" | |
(puts "Usage: #{File.basename $0} widthxheight"; exit 0) if ARGV.size != 1 | |
width, height = ARGV[0].split("x").collect(&:to_i) | |
(puts "Please enter a valid size."; exit 0) if ((width.to_i == 0) or (height.to_i == 0)) | |
half_width = width / 2 | |
FileUtils.cd("images") do | |
Dir['**/*'].each do |f| |
This file contains hidden or 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
#! /usr/bin/python | |
import sys | |
from subprocess import call | |
import os.path | |
dest_ext = "ogg" | |
def convert(source): | |
print("Source: " + source) | |
extension = source[-3:] |
This file contains hidden or 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
from flask import Flask | |
from werkzeug.routing import BaseConverter | |
app = Flask(__name__) | |
class RegexConverter(BaseConverter): | |
def __init__(self, url_map, *items): | |
super(RegexConverter, self).__init__(url_map) | |
self.regex = items[0] |
This file contains hidden or 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
# find mkcert ca path | |
# mkcert -CAROOT | |
# running local tunnel with local https server (nginx), using self signed certificates (mkcert), | |
lt --local-host api.dot.test --port 443 --subdomain dotapi --local-key /home/rashi/src/local-ssl-keys/_wildcard.dot.test+4-key.pem --local-ca /home/rashi/.local/share/mkcert/rootCA.pem --local-cert /home/rashi/src/local-ssl-keys/_wildcard.dot.test+4.pem --local-https true |
OlderNewer