Skip to content

Instantly share code, notes, and snippets.

View mahnunchik's full-sized avatar
🤪
I may be slow to respond.

Evgeny mahnunchik

🤪
I may be slow to respond.
View GitHub Profile
@JedWatson
JedWatson / KeystoneApiExample.md
Last active July 26, 2021 11:29
Example of how to scaffold API endpoints for Posts in a Keystone project (based on the yo keystone example).

This is an example of how to scaffold API endpoints to list / get / create / update / delete Posts in a Keystone website.

It's a modification of the default project created with the yo keystone generator (see https://github.com/JedWatson/generator-keystone)

Gists don't let you specify full paths, so in the project structure the files would be:

routes-index.js        -->    /routes/index.js         // modified to add the api endpoints
routes-api-posts.js    -->    /routes/api/posts.js     // new file containing the Post API route controllers
@johndagostino
johndagostino / certificate
Last active August 29, 2015 13:57
Logstash Forwarder Upstart
mkdir /etc/logstash/private
mkdir /etc/logstash/certs
openssl req -x509 -batch -nodes -newkey rsa:2048 -keyout /etc/logstash/private/server.key -out /etc/logstash/certs/server.crt
@chewbakartik
chewbakartik / Gitlab-CI-Scripts
Last active September 16, 2015 16:47
Gitlab-CI - Build script per branch
# This is the script that is edited in the UI for Gitlab-CI
#
# $CI_BUILD_REF_NAME is provided by Gitlab-CI, it contains the branch the runner is working in.
branch=$CI_BUILD_REF_NAME
if [ $branch = "branch1" ]; then
bash deploy/branch1.sh
fi
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active April 25, 2024 02:01
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@chriskjaer
chriskjaer / gulpfile.js
Last active November 1, 2017 08:22
Gulp recipe: Jade, Sass, Livereload and static server
var gulp = require('gulp'),
gutil = require('gulp-util'),
sass = require('gulp-sass'),
csso = require('gulp-csso'),
uglify = require('gulp-uglify'),
jade = require('gulp-jade'),
concat = require('gulp-concat'),
livereload = require('gulp-livereload'), // Livereload plugin needed: https://chrome.google.com/webstore/detail/livereload/jnihajbhpnppcggbcgedagnkighmdlei
tinylr = require('tiny-lr'),
express = require('express'),

Running redis using upstart on Ubuntu

I've been trying to understand how to setup systems from the ground up on Ubuntu. I just installed redis onto the box and here's how I did it and some things to look out for.

To install:

@marcedwards
marcedwards / high-dpi-media.css
Last active November 19, 2023 12:56
A CSS media query that captures almost all high DPI aware devices.
/* ---------------------------------------------------------- */
/* */
/* A media query that captures: */
/* */
/* - Retina iOS devices */
/* - Retina Macs running Safari */
/* - High DPI Windows PCs running IE 8 and above */
/* - Low DPI Windows PCs running IE, zoomed in */
/* - Low DPI Windows PCs and Macs running Firefox, zoomed in */
/* - Android hdpi devices and above */
@alecperkins
alecperkins / TodoMVC.TodoApp.coffee
Created August 15, 2012 19:57
TodoMVC tutorial in coffeescript
TodoMVC.module 'TodoApp', (App, TodoMVC, Backbone, Marionette, $, _) ->
log arguments
class App.TodoForm extends Marionette.ItemView
events:
'keypress #new-todo' : 'createOnEnter'
'click .mark-all-done' : 'toggleAllClicked'
triggers:
'click .todo-clear a' : 'clear:completed'
@dalethedeveloper
dalethedeveloper / gist:1846552
Created February 16, 2012 17:18
Techniques for Anti-Aliasing @font-face on Windows

#Techniques for Anti-Aliasing @font-face on Windows

It all started with an email from a client: Do these fonts look funky to you? The title is prickly.

The font in question was Port Lligat Sans from Google Web Fonts.

The "prickly" is aliasing caused by lack of hinting

@stuross
stuross / gist:1649731
Created January 20, 2012 21:35
hack to fill gaps in masonry
/**
* jQuery Masonry v2.1.01
* A dynamic layout plugin for jQuery
* The flip-side of CSS Floats
* http://masonry.desandro.com
*
* Licensed under the MIT license.
* Copyright 2011 David DeSandro
*/