Skip to content

Instantly share code, notes, and snippets.

View f3lan's full-sized avatar
💭
Having Fun!

Felix Langenegger f3lan

💭
Having Fun!
View GitHub Profile
@f3lan
f3lan / gist:2483014
Created April 24, 2012 19:38
rspec time
without spork:
real 0m55.521s
user 0m36.810s
sys 0m2.331s
with sprok:
real 0m40.877s
user 0m34.737s
@f3lan
f3lan / gist:3076397
Created July 9, 2012 12:58
ActiveRecord::StatementInvalid: Mysql2::Error when using association name in .where method instead of foreign key
# ruby version: 1.9.3p136
# rails version: 3.2.6
# mysql2 version: 0.3.11
# User - Schema:
# =============
# Table name: users
#
# id :integer(4) not null, primary key
@f3lan
f3lan / kk.js
Last active October 10, 2015 08:47
Kundenkarte
var ENTRYLIMIT = 148;
Function.prototype.method = function(name,func){
this.prototype[name] = func;
return this;
};
Array.method('find', function(value){
for(var i = 0; i < this.length; i++) {
if(this[i] >= value){
@f3lan
f3lan / updatePreOrdrePrices.rb
Created May 21, 2013 19:19
Update wrong prices in specified collection with the right ones.
sql = 'CREATE TABLE update_prices
AS (
SELECT temp_art AS article_id, price_value
FROM (
SELECT *, id AS temp_art
FROM articles
WHERE id IN (
SELECT DISTINCT Z1.article_id
FROM ordering_pre_order_items AS Z1
WHERE Z1.pre_order_id IN (
@f3lan
f3lan / webshop_image_converter.rb
Last active August 29, 2015 14:03
webshop_image_converter.rb
# Image Converter for the NILE Webshop 3.0
#
# Converts the Name in the new stadard formated Name.
# Converts the jpgs to png
#
class WebshopImageConverter
attr_accessor :file, :style_number, :back, :color, :file_type
def initialize(file)
@file = file
@f3lan
f3lan / TheRipper.java
Created March 2, 2016 21:03
Geo Location Ripper for Cell Tower Positions in Switzerland
package pd;
import java.net.MalformedURLException;
import java.net.URL;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.security.cert.X509Certificate;
import java.util.concurrent.Semaphore;
import java.io.*;
@f3lan
f3lan / boxes.rb
Created October 12, 2016 14:03
Creating 6 boxes with numbers in ruby prawn
require "prawn"
Prawn::Document.generate("boxes.pdf") do
y = 20
x = 700
a = 15
gap = 5
6.times do |number|
stroke_rectangle [y, x], a, a
@f3lan
f3lan / ws4monitor.sh
Created June 27, 2017 07:11
Webshop4 Monitoring Script
#!/bin/bash
# Declare Session Variable
SESSION="ey"
function hassession {
tmux has-session -t ey 2>/dev/null
}
# Change to the Webshop 4 Project Dir
@f3lan
f3lan / index.html
Last active November 21, 2019 09:15
Loading Animation
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="./style.css">
</head>
<body>
<aside>
<svg version="1.1" id="Ebene_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 297.6 297.6" style="enable-background:new 0 0 297.6 297.6;" xml:space="preserve">
<g>