Skip to content

Instantly share code, notes, and snippets.

View joladev's full-sized avatar

Johanna Larsson joladev

View GitHub Profile
@city41
city41 / gist:aab464ae6c112acecfe1
Last active January 19, 2021 12:51
ClojureScript secretary client side navigation without hashes

This is the example that comes with the reagent template converted to use HTML5 based history. This means there are no # in the urls.

I just got this working, so there might be better approaches

The changes are

  • use goog.history.Html5history instead of goog.History
  • listen to clicks on the page, extract the path from them, and push them onto the history
  • listen to history changes, and have secretary do its thing in response
@dwwoelfel
dwwoelfel / utils.clj
Created August 1, 2014 06:31
Hack to get something approximating paint rectangles with React/om. Has very rough edges!
(defmacro html [body]
`(if-not (:render-colors? initial-query-map)
(html/html ~body)
(let [body# ~body]
(try
(let [[tag# & rest#] body#
attrs# (if (map? (first rest#))
(first rest#)
{})
rest# (if (map? (first rest#))
@staltz
staltz / introrx.md
Last active July 4, 2024 10:11
The introduction to Reactive Programming you've been missing
@mirontoli
mirontoli / head.md
Last active August 29, 2015 14:02 — forked from joladev/katze.clj

ekvation 1:

15h + k + 0,25m = 100 (1)

multiplicerad med 4 för att få heltal:

60h + 4k + m = 400 (1)

ekvation 2:

@sergeifilippov
sergeifilippov / domain-nginx.conf
Created February 10, 2014 03:22
linux-dash with nginx
server {
server_name $domain_name;
root /var/www;
index index.html index.php;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
# Cache static files for as long as possible
location ~* \.(?:xml|ogg|mp3|mp4|ogv|svg|svgz|eot|otf|woff|ttf|css|js|jpg|jpeg|gif|png|ico)$ {
try_files $uri =404;
@chengyin
chengyin / linkedout.js
Last active July 11, 2021 15:23
Unsubscribe all LinkedIn email in "one click". For an easier to use version, you can check out the bookmarklet: http://chengyin.github.io/linkedin-unsubscribed/
// 1. Go to page https://www.linkedin.com/settings/email-frequency
// 2. You may need to login
// 3. Open JS console
// ([How to?](http://webmasters.stackexchange.com/questions/8525/how-to-open-the-javascript-console-in-different-browsers))
// 4. Copy the following code in and execute
// 5. No more emails
//
// Bookmarklet version:
// http://chengyin.github.io/linkedin-unsubscribed/
@mirontoli
mirontoli / ChocoScript.ps1
Last active June 14, 2016 04:37
This script install the development tools I need in a Windows Server with SharePoint. Chocolatey: http://chocolatey.org/It must be run in cmd
# Install Chocolatey
iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex
# Install Tools
# choco install ulsviewer &
choco install GoogleChrome -y
choco install vim -y
choco install SharePointDesigner2013x64 -y
choco install ilspy -y
choco install fiddler4 -y
@nodesocket
nodesocket / bootstrap.flatten.css
Last active April 1, 2021 23:37
Below are simple styles to "flatten" bootstrap. I didn't go through every control and widget that bootstrap offers, only what was required for https://commando.io, so your milage may vary.
/* Flatten das boostrap */
.well, .navbar-inner, .popover, .btn, .tooltip, input, select, textarea, pre, .progress, .modal, .add-on, .alert, .table-bordered, .nav>.active>a, .dropdown-menu, .tooltip-inner, .badge, .label, .img-polaroid {
-moz-box-shadow: none !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
-webkit-border-radius: 0px !important;
-moz-border-radius: 0px !important;
border-radius: 0px !important;
border-collapse: collapse !important;
background-image: none !important;
@mirontoli
mirontoli / lang.js
Last active November 3, 2023 15:15
Get Language name based on iso 639-1 code
/**
* @author Anatoly Mironov (mirontoli)
* http://sharepointkunskap.wordpress.com
* http://www.bool.se
*
* http://stackoverflow.com/questions/3605495/generate-a-list-of-localized-language-names-with-links-to-google-translate/14800384#14800384
* http://stackoverflow.com/questions/10997128/language-name-from-iso-639-1-code-in-javascript/14800499#14800499
*
* using Phil Teare's answer on stackoverflow
* http://stackoverflow.com/questions/3217492/list-of-language-codes-in-yaml-or-json/4900304#4900304
@domenic
domenic / README.md
Last active June 24, 2021 16:37
Using promises in a UI context

The scenario:

  • We are writing a digital textbook-reading app.
  • Most of the time you have a "basic" license for your textbook, but one (and only one) of your computers can request an "enhanced" license.
  • You can only print from the computer with the enhanced license.

The problem statement: