Skip to content

Instantly share code, notes, and snippets.

View Almad's full-sized avatar

Almad Almad

View GitHub Profile
@Almad
Almad / obsidian-web-clipper.js
Last active October 28, 2023 13:06 — forked from kepano/obsidian-web-clipper.js
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
javascript: (function() {
function main() {
if (!window.Turndown || !window.Readability) {
console.log("Libraries not loaded, see below")
console.log(window.Turndown)
console.log(window.Readability)
}
else {
console.log("loading")
let Readability = window.Readability;
@Almad
Almad / project.tf
Last active July 13, 2022 21:33
A Simple AWS Site With Terraform
terraform {
backend "s3" {
bucket = "almad-terraform-states"
key = "mywebapp/state"
region = "eu-central-1"
}
}
provider "aws" {
FORMAT: 1A
# testing
## Notes [/notes/]
### Retrieve a Note [GET]
+ Response 403 (application/json)
The templateId provided is not valid for the event receiver as specified by the api key.
@Almad
Almad / test.md
Created September 26, 2015 18:04
Test

this_is_interesting

on_so_many level s

@Almad
Almad / example.js
Last active January 3, 2016 04:19 — forked from anonymous/example.js
Do not recurse
var https = require('https');
var limit = 2 * 1000;
function fetch(cb) {
var req = https.request('https://url', function(res) {
var text = '';
res.on('data', function(chunk) {
text += chunk;
@Almad
Almad / blueprint.md
Created November 21, 2013 22:35
shortcut demonstration

FORMAT: 1A

xoxo test

Notes API is a short texts saving service similar to its physical paper presence on your table.

Company group

Notes related resources of the Notes API

Notes Collection [/notes]

List all Notes [GET]

@Almad
Almad / gist:3955423
Created October 25, 2012 21:08
grunt spawn
grunt.util.spawn cmd: 'ls', args: ['./node_modules/.bin/nodemon'], (err, result, code) ->
console.error 'err', err
console.error 'result', result
console.error 'code', code
grunt.util.spawn cmd: './node_modules/.bin/nodemon', (err, result, code) ->
console.error 'err', err
console.error 'result', result
console.error 'code', code
@Almad
Almad / logreader.coffee
Created September 20, 2012 15:26
Simple realtime logreader in node.js & socket.io & coffee script
events = require 'events'
http = require 'http'
socketIo = require 'socket.io'
app = http.createServer((req, res) ->
res.end '''
<html><head>
<script src="/socket.io/socket.io.js" type="text/javascript"></script>
<script>
var socket = io.connect('http://localhost');
@Almad
Almad / logreader
Created September 20, 2012 15:26
Simple realtime logreader in node.js & socket.io & coffee script
events = require 'events'
http = require 'http'
socketIo = require 'socket.io'
server = http.createServer((req, res) ->
res.end '''
<html><head>
<script src="/socket.io/socket.io.js" type="text/javascript"></script>
<script>
@Almad
Almad / gist:3303863
Created August 9, 2012 12:39
cmd fix approach
async = require 'async'
datamodel= require '../lib/datamodel'
mongoose = require 'mongoose'
Traffic = mongoose.model 'Traffic'
mongoose.connection.once 'open', ->
Traffic.find {}, (err, traffic) ->
async.forEach traffic, (hit, done) ->
hit.fixSomething