Skip to content

Instantly share code, notes, and snippets.

View heralight's full-sized avatar

Alexandre Richonnier heralight

View GitHub Profile
def itemListActionsTemplate : NodeSeq = <xml:group>
<a crud:edit_href="" title={S.??("edit")} class="ss_sprite ss_pencil" ></a>
<a crud:delete_href="" title={S.??("delete")} class="ss_sprite ss_delete"></a>
</xml:group>
def itemListActions(item: CrudType, in:NodeSeq):NodeSeq = {
bind("crud", in,
AttrBindParam("edit_href", Text(editItemPathString+"/"+ (obscurePrimaryKey(item))),"href"),
AttrBindParam("view_href", Text(viewPathString+"/"+(obscurePrimaryKey(item))),"href"),
AttrBindParam("delete_href", Text(deletePathString+"/"+ (obscurePrimaryKey(item))),"href")
@h4cc
h4cc / readme.md
Last active June 17, 2017 18:12
Backups with Ubuntu BackInTime onto a Synology DSM5 via SSH
@wireframe
wireframe / gist:75088
Created March 6, 2009 21:53
jquery plugin to truncate elements based on height instead of number of characters
/*
truncates elements that pass a certain height.
adds a "view more" link to display the rest of the content.
a different approach than standard truncation which relies on character counting.
character counting may not be desireable when elements have short words, but a
number of line breaks.
usage:
//using defaults
@millermedeiros
millermedeiros / build.js
Created May 9, 2012 01:15
sample node.js build script including RequireJS optimizer (r.js) and copy/delete/filter files
// Combine JS and CSS files
// ---
//
// Make sure you install the npm dependencies
// > cd YOUR_PROJECT_FOLDER
// > npm install
//
// Than run:
// > node build
@marshallswain
marshallswain / authentication.js
Last active September 24, 2021 08:59
Example tools for using querystring redirects with Feathers OAuth login.
'use strict';
const authentication = require('feathers-authentication');
const jwt = require('feathers-authentication-jwt');
const local = require('feathers-authentication-local');
const oauth2 = require('feathers-authentication-oauth2');
const GithubStrategy = require('passport-github');
// Bring in the oauth-handler
const makeHandler = require('./oauth-handler');
@xmlking
xmlking / kubernetes.md
Last active November 12, 2022 11:56
Kubernetes Cheat Sheet

Kubernetes

Install

Prerequisites

  1. Bash v5+ checkout Upgrading Bash on macOS
  2. bash-completion@2

Install Docker and Kubernetes(k8s)

@aus
aus / rclone_install_beta.sh
Last active January 19, 2023 03:57
lastest beta rclone install script
#!/bin/bash
mkdir /tmp/rclone_install
cd /tmp/rclone_install
curl -s -O https://beta.rclone.org/rclone-beta-latest-linux-amd64.zip
unzip -q rclone-beta-latest-linux-amd64.zip
cd rclone-*-linux-amd64
@rohan20
rohan20 / flutter_google_maps_bottom_sheet.dart
Last active July 4, 2023 15:38
Flutter Google Maps Bottom Sheet
import 'package:flutter/material.dart';
class GoogleMapsClonePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Stack(
children: <Widget>[
CustomGoogleMap(),
CustomHeader(),
@joshbirk
joshbirk / samplerest.js
Created February 3, 2012 19:57
Sample of using passport w/ mult strategies
var fs = require("fs")
var ssl_options = {
key: fs.readFileSync('privatekey.pem'),
cert: fs.readFileSync('certificate.pem')
};
var port = process.env.PORT || 3000;
var express = require('express');
var ejs = require('ejs');
var passport = require('passport')