Simple analog clock.
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
var svg = document.querySelector( "svg" ); | |
var svgData = new XMLSerializer().serializeToString( svg ); | |
var canvas = document.createElement( "canvas" ); | |
var ctx = canvas.getContext( "2d" ); | |
var img = document.createElement( "img" ); | |
img.setAttribute( "src", "data:image/svg+xml;base64," + btoa( svgData ) ); | |
img.onload = function() { |
This is a demo gist to test my gist viewer. The Javascript may not be written by me :D
This is a test for update.
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
(defface collapsed-face '((t (:background "#e0cf9f" :foreground "#5f5f5f"))) "Collapsed Overlay") | |
(defvar collapsed-face 'collapsed-face) | |
(define-fringe-bitmap 'hs-marker [0 24 24 126 126 24 24 0]) | |
(defun display-code-line-counts (ov) | |
(when (eq 'code (overlay-get ov 'hs)) | |
(let* ((marker-string "*fringe-dummy*") | |
(marker-length (length marker-string)) | |
(display-string | |
(format " (%d)... " |
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
# input: | |
# 1 1 | |
# 2 2 | |
# 3 3 | |
# 4 4 | |
# 5 5 | |
# 6 6 | |
# 7 7 | |
# output: | |
# 1 |
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
#!/bin/bash | |
# usage: ./clsfunccnt <directory> <filename-regex> <classname> | |
find $1 -regex "$2" -exec cat {} \; | \ | |
sed -n " | |
# find target class | |
/^class\s\+$3:/,/^class.*/{ | |
# print all def's with 4 spaces indent | |
/\s\{4\}def\s\+.*/p |
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
#include <fstream> | |
#include <mpi.h> | |
inline double convolute(double **img, const double (*w)[11], | |
int r, int c) | |
{ | |
double s = 0; | |
for (int i = 0; i < 11; ++i) | |
for (int j = 0; j < 11; ++j) | |
s += img[r-5+i][c-5+j] * w[i][j]; |
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
# suppose you have created a ui file called configwin.ui | |
cmake_minimum_required (VERSION 2.6) | |
project(tst) | |
find_package(Qt5Widgets) | |
set(CMAKE_AUTOMOC ON) | |
set(CMAKE_INCLUDE_CURRENT_DIR ON) |
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
<script type="text/javascript">// <![CDATA[ | |
function callTheJsonp() | |
{ | |
// the url of the script where we send the asynchronous call | |
var url = "http://localhost/utils/jsonp/ajax.php?callback=parseRequest"; | |
// create a new script element | |
var script = document.createElement('script'); | |
// set the src attribute to that url | |
script.setAttribute('src', url); | |
// insert the script in out page |