Skip to content

Instantly share code, notes, and snippets.

Axel axelerator

  • Shopify
  • Montreal, Canada
Block or report user

Report or block axelerator

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
@axelerator
axelerator / handleplay.ino
Created Oct 18, 2018
Customize play function to support different frequencies
View handleplay.ino
void handlePlay() {
String response = "POSTED";
response += server.arg("timings");
readCSV(server.arg("timings"));
for (int i = 0; i < current_data_length; ++i) {
Serial.println(signal_data[i]);
}
int frequency = server.arg("frequency").toInt();
irsend.sendRaw(signal_data, current_data_length, frequency); // Send a raw data capture at frequency given as request parameter.
server.sendHeader("Access-Control-Allow-Origin", "*");
@axelerator
axelerator / yaml key sorting in vim
Last active Sep 21, 2017
yaml key sorting in vim
View yaml key sorting in vim
nmap <leader>y :!yml-sorter -i % -o %<CR>
https://www.npmjs.com/package/yml-sorter
View gist:01ab50c21a25a1b93164f86a087dfda0
upstream app {
# Path to Unicorn SOCK file, as defined previously
server unix:/var/www/APP_NAME/shared/sockets/unicorn.sock fail_timeout=0;
}
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name APP_NAME.42ls.de APP_NAME.42ls.de;
View custom_search.rb
class HomeController < ApplicationController
class MovieSearch < FortyFacets::FacetSearch
model 'Movie' # which model to search for
custom :for_manual_handling
end
def index
View Find unused variables in sass files
or i in `grep -h '^$[a-z_][^:]*' *.sass | sed 's|$\([a-z_][^:]*\).*|\1|'` ; do echo -n $i; grep $i *.sass | wc -l ; done | grep ' 1$'
@axelerator
axelerator / onliners
Last active Apr 22, 2016
oneliners.md
View onliners
# Ruby
Hash[*((0..4).flat_map{|i| ['column_' + i.to_s, nil]})]
# => {"column_0"=>nil, "column_1"=>nil, "column_2"=>nil, "column_3"=>nil, "column_4"=>nil}
# Shell
### Bildersequenzen in Video für Web konvertieren mit:
@axelerator
axelerator / sumgitachievements.sh
Created Sep 27, 2011
sum of all git achievement levels
View sumgitachievements.sh
git achievements -l | grep '(Level' | sed 's/\(\s*.*(Level\)//g' | tr -d ')' | tr -s ' ' |tr "\n" '+' | sed 's/$/ 0/' | xargs expr
@axelerator
axelerator / namevoting
Created Jun 19, 2011
Small programm to combine syllables, where some syllables are used only as suffix/prefix
View namevoting
{-
- Small programm to combine syllables, where some syllables
- are used only as suffix/prefix
- 1. Install: GHC
- 2. Compile: ghc -o namevote namevoting.hs
- 3. Run: namevote '[Pre "neo", Suf "master", Pre "turbo", Uni "leo", Suf "3000"]'
-}
module Main where
import System.Environment
View Pickle.hs
{-# LANGUAGE Arrows #-}
module Pickle where
import Control.Arrow
import Control.Arrow.ListArrow
import Text.XML.HXT.Arrow.Pickle
import Text.XML.HXT.Arrow.ReadDocument
data Strukt = Strukt {
text :: String
View gist:674032
public interface KeyValueFunction<KI, VI, KO, VO> {
Map.Entry<KO, VO> f(KI k, VI v);
}
/**
* Creates a new map by applying each element to the converter.
*
* @param <KI> key type of input map
* @param <VI> value type of input map
You can’t perform that action at this time.