Skip to content

Instantly share code, notes, and snippets.

@NunoFilipeSantos
NunoFilipeSantos / synctorrent.sh
Last active July 26, 2018 16:54
A Bash Script to copy files via SFTP from your remote Seedbox
#!/bin/bash
login=$YOURUSERNAME
pass=$YOURPASSWORD
host=sftp://YOURIPADDRESS
remote_dir=/$YOURDOWNLOADFOLDER
local_dir=/$YOURLOCALFOLDER
trap "rm -f /tmp/synctorrent.lock" SIGINT SIGTERM
@adham90
adham90 / spacemacs-keybindings
Last active April 5, 2024 14:24
spacemacs keybindings that i need to learn
SPC s c remove highlight
**** Files manipulations key bindings
Files manipulation commands (start with ~f~):
| Key Binding | Description |
|-------------+----------------------------------------------------------------|
| ~SPC f c~ | copy current file to a different location |
| ~SPC f C d~ | convert file from unix to dos encoding |
| ~SPC f C u~ | convert file from dos to unix encoding |
@bling
bling / helm-fzf.el
Last active September 5, 2018 00:02
(defvar helm-fzf-source
(helm-build-async-source "fzf"
:candidates-process 'helm-fzf--do-candidate-process
:nohighlight t
:requires-pattern 2
:candidate-number-limit 9999))
(defun helm-fzf--do-candidate-process ()
(let* ((cmd-args `("fzf" "-x" "-f" ,helm-pattern))
(proc (apply #'start-file-process "helm-fzf" nil cmd-args)))
@jaceklaskowski
jaceklaskowski / deployment-tool-ansible-puppet-chef-salt.md
Last active January 3, 2024 22:12
Choosing a deployment tool - ansible vs puppet vs chef vs salt

Requirements

  • no upfront installation/agents on remote/slave machines - ssh should be enough
  • application components should use third-party software, e.g. HDFS, Spark's cluster, deployed separately
  • configuration templating
  • environment requires/asserts, i.e. we need a JVM in a given version before doing deployment
  • deployment process run from Jenkins

Solution

@ohanhi
ohanhi / frp.md
Last active May 6, 2024 05:17
Learning FP the hard way: Experiences on the Elm language

Learning FP the hard way: Experiences on the Elm language

by Ossi Hanhinen, @ohanhi

with the support of Futurice 💚.

Licensed under CC BY 4.0.

Editorial note

@protrolium
protrolium / ffmpeg.md
Last active May 15, 2024 18:27
ffmpeg guide

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

You can get the list of installed codecs with:

@kyledrake
kyledrake / boring.rb
Created April 5, 2015 23:52
Neocities boring web site detector
require 'rmagick'
require 'pry'
$filtered_sites = []
def web_site_too_blank?(path)
img = Magick::Image.read(path).first
pix = img.scale(1, 1)
average_color = pix.pixel_color(0,0)
@yoshikischmitz
yoshikischmitz / fizzbuzz_without_conditionals.rb
Last active August 29, 2015 14:16
A highly extensible, declarative fizzbuzz with no hardcoded if statements, and no mutation.
applicators = {3 => "fizz", 5 => "buzz"}
fizzbuzz =
(1..100).map do |n|
fb = applicators.
select{|a| n % a == 0}.
values.join
[n.to_s, fb].max # "1" > "" and "fizz" > "100000" since "1" < "a"
end
puts fizzbuzz
@amandavisconti
amandavisconti / gist:e909e41e6896d2a90de8
Created February 6, 2015 14:11
Setting up Annotator.js annotation on Drupal
Annotator.js works on Drupal as two modules and a library (installed, as usual, under /sites/all):
/modules/annotator
/modules/annotation
/libraries/annotator
The files in libraries/annotator are the latest from the Annotator.js repo (https://github.com/openannotation/annotator/releases). Although the modules Infinite Ulysses uses have been significantly changed from the modules you could download on Drupal.org, the Drupal.org Annotator (https://www.drupal.org/project/annotator) and Annotation (https://www.drupal.org/project/annotation) modules pages might still have useful info if you're troubleshooting.
Instructions:
I'll refer to the two modules as "Annotator" and "Annotation" throughout, and use "libraries/annotator" if I'm referring to the JS library.
1. Rename /libraries/annotator folder as just "annotator" and place in your sites/all/libraries folder (create a libraries folder there if you don't already have one).