Skip to content

Instantly share code, notes, and snippets.

Victor Nawothnig dminuoso

Block or report user

Report or block dminuoso

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dminuoso
dminuoso / Sentinel.hs
Created Jul 20, 2018 — forked from borsboom/Sentinel.hs
hedis wrapper for Redis Sentinel support
View Sentinel.hs
{-# LANGUAGE DeriveDataTypeable, FlexibleContexts, MultiParamTypeClasses, NamedFieldPuns,
NoImplicitPrelude, OverloadedStrings, RankNTypes, ScopedTypeVariables, TupleSections,
ConstraintKinds, TemplateHaskell, StandaloneDeriving #-}
{-# OPTIONS_GHC -funbox-strict-fields -Wall -Werror #-}
-- dependencies: hedis retry safe data-default uuid monad-logger basic-prelude lifted-base either
-- | Wrapper for hedis to support redis-sentinel. It is
-- built-atop of, and re-exports most of, the "Database.Redis" module.
--
View foo.js
const toggleClass = (id, toggle) => id === toggle ? 'toggle active' : 'toggle inactive';
const Style = ({ activeFontColor, activeBackgroundColor, fontColor }) => (
<style jsx>
{`
.toggle {
width: 50%;
height: 50px;
border-radius: 100px;
line-height: 50px;
View ajax.js
$("#ajax-action2").click( function() {
const AUTH_TOKEN = $("meta[name=csrf-token]").attr("content");
request = $.ajax({
type: "PATCH",
url: "/home/no_js_view_action",
headers: {
'X_CSRF_TOKEN': AUTH_TOKEN,
},
dataType: "json",
data: {
View some.js
// Arrow function
$("#ajax-action2").click(() => {
const AUTH_TOKEN = $("meta[name=csrf-token]").attr("content");
// const
const request = $.ajax({
type: "PATCH",
url: "/home/no_js_view_action",
headers: {
'X_CSRF_TOKEN': AUTH_TOKEN,
View random.rb
takeEven = lambda.select do |x|
x if x % 2 == 0
end
View random.rb
takeEven = lambda.select do |x|
x if x % 2 == 0
end
View random.rb
[0,1,2,3,4,5,6,7,8,9].select do |x|
x if x%2==0
end
View foo.js
// The call with a callback to self
try {
winfo = windarea.getWindInfo2(LonLat.lat, LonLat.lon, this.time, wante, wpost);
//this.drawWind(ctx, p.x, p.y, winfo);
var MI = GribMgr.WindAtPointInTime(new Date(this.time*1000),LonLat.lat, LonLat.lon,
function(){this.drawWindArea(p, poslimit, windarea, ctx)})
if (MI)
{
winfo = new Wind(MI.Speed, MI.Heading);
this.drawWind(ctx, p.x, p.y, winfo);
View application.html.haml
- if Rails.env.production?
%script
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-15209814-7', 'auto');
ga('send', 'pageview');
%script
View gist:3cb4b013f77188c2c4220d339b025377
self.num_reserved = order_data.match(/\"ordered\"\:.*\n/)[0].match(/\d+/)[0]
You can’t perform that action at this time.