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
| ;;;; Hippie-expand: | |
| (setq hippie-expand-try-functions-list ; functions to use for expansion | |
| '(try-complete-lisp-symbol-partially | |
| try-expand-dabbrev | |
| try-expand-all-abbrevs | |
| try-complete-file-name-partially | |
| try-complete-file-name | |
| try-expand-list | |
| try-expand-line | |
| try-expand-dabbrev-all-buffers |
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
| void quicksort(int l, int u) | |
| { int i, m; | |
| // Return if length is 0 | |
| if (l >= u) { | |
| return; | |
| } | |
| // Move random element to start | |
| swap(l, randint(l, u)); | |
| m = l; | |
| // Iterate all element after start |
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
| def quicksort(l, start, end): | |
| if end - start < 2: | |
| return l | |
| # Move random element to start as pivot | |
| pivot = random.randrange(start, end) | |
| l[start], l[pivot] = l[pivot], l[start] | |
| # Iterate, and move all elements smaller than pivot to the start. | |
| firsthigh = start |
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 showf = require("fixed-width-float"); | |
| var rows = [ | |
| [ 1, 2, 250.212, 987654321 ], | |
| [ -3, -0.00001234, 6.212e-20, -555.5555 ], | |
| [ -500000, 32.105e99, -7.2e5, 6.1e-9 ], | |
| [ 4, -10, 9950.255, -9.96e-50 ] | |
| ]; | |
| rows.forEach(function (row) { |
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 likely = require("likely.js"); | |
| var data = {list:[1, 2, 3]}; | |
| var template = likely.Template([ | |
| 'for key, value in list', | |
| ' p', | |
| ' {{ value }}' | |
| ]); | |
| var div = document.createElement("div"); |
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 likely = require("likely.js"); | |
| var data = {list:[1, 2, 3]}; | |
| var template = likely.Template([ | |
| 'for key, value in list', | |
| ' p', | |
| ' {{ value }}' | |
| ]); | |
| var div = document.createElement("div"); |
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
| // example using the raf module from npm. try changing some values! | |
| var requestAnimationFrame = require("raf") | |
| var canvas = document.createElement("canvas") | |
| canvas.width = 500 | |
| canvas.height = 500 | |
| document.body.appendChild(canvas) | |
| var context = canvas.getContext("2d") |
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 insertCSS = require('insert-css') | |
| var domify = require('domify') | |
| var css = ".button { display: inline-block; font-family: Arial; background-color: papayawhip; padding: 10px; border: 1px solid salmon; }" | |
| var html = '<div class="button">BUTTON</div>' | |
| // inserts new <style> tag into the <head> | |
| insertCSS(css) | |
| // append the html elements that domify returns to the <body> |
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 insertCSS = require('insert-css') | |
| var domify = require('domify') | |
| var css = ".element { width: 100px; height: 100px; background-color: black; -webkit-transition: 250ms ease-out; -webkit-transform: translate(40px, 40px);}" | |
| var html = domify('<div class="element"></div> <div class="output"></div>'); | |
| // inserts new <style> tag into the <head> | |
| insertCSS(css) |
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
| (setq user-mail-address "[email protected]") | |
| (setq user-full-name "Sverre Johansen") | |
| ;(load-library "smtpmail") | |
| (load-library "nnimap") | |
| (load-library "starttls") | |
| ; NOV format instead of plain HEAD | |
| (setq nnimap-nov-is-evil nil) | |
| (setq mail-self-blind t) |
OlderNewer